Skip to content

Commit

Permalink
mfd: tc6387xb: Remove unnecessary braces and correct style warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Lee Jones committed Jul 25, 2014
1 parent 3103de8 commit d5ce79f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/mfd/tc6387xb.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,10 @@ static int tc6387xb_probe(struct platform_device *dev)
int irq, ret;

iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!iomem) {
if (!iomem)
return -EINVAL;
}

tc6387xb = kzalloc(sizeof *tc6387xb, GFP_KERNEL);
tc6387xb = kzalloc(sizeof(*tc6387xb), GFP_KERNEL);
if (!tc6387xb)
return -ENOMEM;

Expand Down Expand Up @@ -189,7 +188,7 @@ static int tc6387xb_probe(struct platform_device *dev)
if (pdata && pdata->enable)
pdata->enable(dev);

printk(KERN_INFO "Toshiba tc6387xb initialised\n");
dev_info(&dev->dev, "Toshiba tc6387xb initialised\n");

ret = mfd_add_devices(&dev->dev, dev->id, tc6387xb_cells,
ARRAY_SIZE(tc6387xb_cells), iomem, irq, NULL);
Expand Down

0 comments on commit d5ce79f

Please sign in to comment.