aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2015-10-27 12:19:31 -0400
committerLee Jones <lee.jones@linaro.org>2016-01-14 03:43:53 -0500
commit15544cab2880c6990704ff91c0f11c5ccc3aafad (patch)
treeadafb42ab3216237e602218b6355dc6e527fe245 /drivers/mfd
parent4374b20c6c4fa8533e932567be9cd8872286da95 (diff)
mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch
WARNING: Missing a blank line after declarations + struct ab3100 *ab3100 = dev_get_drvdata(dev->parent); + if (!ab3100->startup_events_read) WARNING: Possible unnecessary 'out of memory' message + if (!ab3100) { + dev_err(&client->dev, "could not allocate AB3100 device\n"); WARNING: else is not generally useful after a break or return + break; + } else { total: 0 errors, 3 warnings, 996 lines checked Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/ab3100-core.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index f0afb44271f8..6a5a98806cb8 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -381,9 +381,11 @@ static int ab3100_event_registers_startup_state_get(struct device *dev,
381 u8 *event) 381 u8 *event)
382{ 382{
383 struct ab3100 *ab3100 = dev_get_drvdata(dev->parent); 383 struct ab3100 *ab3100 = dev_get_drvdata(dev->parent);
384
384 if (!ab3100->startup_events_read) 385 if (!ab3100->startup_events_read)
385 return -EAGAIN; /* Try again later */ 386 return -EAGAIN; /* Try again later */
386 memcpy(event, ab3100->startup_events, 3); 387 memcpy(event, ab3100->startup_events, 3);
388
387 return 0; 389 return 0;
388} 390}
389 391
@@ -858,10 +860,8 @@ static int ab3100_probe(struct i2c_client *client,
858 int i; 860 int i;
859 861
860 ab3100 = devm_kzalloc(&client->dev, sizeof(struct ab3100), GFP_KERNEL); 862 ab3100 = devm_kzalloc(&client->dev, sizeof(struct ab3100), GFP_KERNEL);
861 if (!ab3100) { 863 if (!ab3100)
862 dev_err(&client->dev, "could not allocate AB3100 device\n");
863 return -ENOMEM; 864 return -ENOMEM;
864 }
865 865
866 /* Initialize data structure */ 866 /* Initialize data structure */
867 mutex_init(&ab3100->access_mutex); 867 mutex_init(&ab3100->access_mutex);
@@ -883,20 +883,17 @@ static int ab3100_probe(struct i2c_client *client,
883 883
884 for (i = 0; ids[i].id != 0x0; i++) { 884 for (i = 0; ids[i].id != 0x0; i++) {
885 if (ids[i].id == ab3100->chip_id) { 885 if (ids[i].id == ab3100->chip_id) {
886 if (ids[i].name != NULL) { 886 if (ids[i].name)
887 snprintf(&ab3100->chip_name[0],
888 sizeof(ab3100->chip_name) - 1,
889 "AB3100 %s",
890 ids[i].name);
891 break; 887 break;
892 } else { 888
893 dev_err(&client->dev, 889 dev_err(&client->dev, "AB3000 is not supported\n");
894 "AB3000 is not supported\n"); 890 goto exit_no_detect;
895 goto exit_no_detect;
896 }
897 } 891 }
898 } 892 }
899 893
894 snprintf(&ab3100->chip_name[0],
895 sizeof(ab3100->chip_name) - 1, "AB3100 %s", ids[i].name);
896
900 if (ids[i].id == 0x0) { 897 if (ids[i].id == 0x0) {
901 dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n", 898 dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n",
902 ab3100->chip_id); 899 ab3100->chip_id);