Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: tc6387xb: Remove unnecessary braces and correct style warnings

This is part of an effort to clean-up the MFD subsystem.

WARNING: braces {} are not necessary for single statement blocks
+ if (!iomem) {
+ return -EINVAL;
+ }

WARNING: sizeof *tc6387xb should be sizeof(*tc6387xb)
+ tc6387xb = kzalloc(sizeof *tc6387xb, GFP_KERNEL);

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
+ printk(KERN_INFO "Toshiba tc6387xb initialised\n");

total: 0 errors, 3 warnings, 242 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>

Lee Jones d5ce79ff 3103de8c

+3 -4
+3 -4
drivers/mfd/tc6387xb.c
··· 147 147 int irq, ret; 148 148 149 149 iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); 150 - if (!iomem) { 150 + if (!iomem) 151 151 return -EINVAL; 152 - } 153 152 154 - tc6387xb = kzalloc(sizeof *tc6387xb, GFP_KERNEL); 153 + tc6387xb = kzalloc(sizeof(*tc6387xb), GFP_KERNEL); 155 154 if (!tc6387xb) 156 155 return -ENOMEM; 157 156 ··· 188 189 if (pdata && pdata->enable) 189 190 pdata->enable(dev); 190 191 191 - printk(KERN_INFO "Toshiba tc6387xb initialised\n"); 192 + dev_info(&dev->dev, "Toshiba tc6387xb initialised\n"); 192 193 193 194 ret = mfd_add_devices(&dev->dev, dev->id, tc6387xb_cells, 194 195 ARRAY_SIZE(tc6387xb_cells), iomem, irq, NULL);