From patchwork Mon Dec 7 11:50:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 57765 Delivered-To: patch@linaro.org Received: by 10.202.179.86 with SMTP id c83csp944601oif; Mon, 7 Dec 2015 03:50:52 -0800 (PST) X-Received: by 10.66.149.229 with SMTP id ud5mr41843288pab.83.1449489052624; Mon, 07 Dec 2015 03:50:52 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e73si947022pfj.171.2015.12.07.03.50.52; Mon, 07 Dec 2015 03:50:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932111AbbLGLus (ORCPT + 28 others); Mon, 7 Dec 2015 06:50:48 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:33359 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755124AbbLGLuo (ORCPT ); Mon, 7 Dec 2015 06:50:44 -0500 Received: by wmec201 with SMTP id c201so161525427wme.0 for ; Mon, 07 Dec 2015 03:50:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=re3K7cMC+dEjlr8hBCIvo/WMYVAtupyRkpBsyDtA8Us=; b=lpzrm01HcLUbJATlpOnH8za2cQiGoQZY01jC/5ryHdE2zbEYaHESEgJb8sLp6gtFrl VogKSaCwiHApT3mx9/S55iEHhNWBjrtBq59UaXlkF/Gcu30oN1pORsyTJk8HDHzrFfYY lVFKeyZylpx7YQSru7GDDDHoUauhbxi+amb1znSvrUBkBE63ruL0bY5eN1fYgEo0wYZO +Rf6MGKFBlbcp8BFO2US8NcS/FtRLqm2Ni68LwoKX5/4y9F1zSG7Lx2PSkEGGejx4gmf d2roRg1374xLveqTV9mgY7IX0iv8DUKStAqiAI5EuQWdEODhRlm1icXr5WGjZyf5nsAK 8oPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=re3K7cMC+dEjlr8hBCIvo/WMYVAtupyRkpBsyDtA8Us=; b=ObG8xIjKm+FMOJtQA7FSHhXjtpmSIrGnivrdP9dGBHA2Bf7hV1IvJYYM55dS5m2cCD F1doOB47alXnRsrm2ejyanjj199yAyK65VvY4hARYkrchH4vn5/VRXXQKt9uEREO9Gzi bjG7DQBUfkMzQw1RE3P5FWiMFrYJHvjrbVn9It0mmL6wzBkkwwwPq0uzXNWIvmNr5a8Z 543cRWyoaIVgv7Yam8PFMnzfsWyDMEXy+uyEP3/tx3pQIe94c/0oi1QOwAArgvzDYwRq y6LVpI3CkSnCVicJ4znGvsJXI/Jw7WSoxyH1PL8qeY4FWqDozXtciZSdnq6/XD6WSroo 9OSg== X-Gm-Message-State: ALoCoQnkjGJw3vTQcNyZjp/rmnSE9sBsobq5DYJHieQlMGhgE3eQ619OmjoHxAtX36wIpGAdg1oI X-Received: by 10.195.18.6 with SMTP id gi6mr35569108wjd.83.1449489043200; Mon, 07 Dec 2015 03:50:43 -0800 (PST) Received: from localhost.localdomain (host81-129-174-134.range81-129.btcentralplus.com. [81.129.174.134]) by smtp.gmail.com with ESMTPSA id z1sm24806533wje.35.2015.12.07.03.50.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Dec 2015 03:50:42 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/19] mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch Date: Mon, 7 Dec 2015 11:50:15 +0000 Message-Id: <1449489032-14374-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449489032-14374-1-git-send-email-lee.jones@linaro.org> References: <1449489032-14374-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Lee Jones --- drivers/mfd/ab3100-core.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c index f0afb44..6a5a988 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, u8 *event) { struct ab3100 *ab3100 = dev_get_drvdata(dev->parent); + if (!ab3100->startup_events_read) return -EAGAIN; /* Try again later */ memcpy(event, ab3100->startup_events, 3); + return 0; } @@ -858,10 +860,8 @@ static int ab3100_probe(struct i2c_client *client, int i; ab3100 = devm_kzalloc(&client->dev, sizeof(struct ab3100), GFP_KERNEL); - if (!ab3100) { - dev_err(&client->dev, "could not allocate AB3100 device\n"); + if (!ab3100) return -ENOMEM; - } /* Initialize data structure */ mutex_init(&ab3100->access_mutex); @@ -883,20 +883,17 @@ static int ab3100_probe(struct i2c_client *client, for (i = 0; ids[i].id != 0x0; i++) { if (ids[i].id == ab3100->chip_id) { - if (ids[i].name != NULL) { - snprintf(&ab3100->chip_name[0], - sizeof(ab3100->chip_name) - 1, - "AB3100 %s", - ids[i].name); + if (ids[i].name) break; - } else { - dev_err(&client->dev, - "AB3000 is not supported\n"); - goto exit_no_detect; - } + + dev_err(&client->dev, "AB3000 is not supported\n"); + goto exit_no_detect; } } + snprintf(&ab3100->chip_name[0], + sizeof(ab3100->chip_name) - 1, "AB3100 %s", ids[i].name); + if (ids[i].id == 0x0) { dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n", ab3100->chip_id);