From patchwork Wed Feb 12 09:10:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 24522 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ABDC3203F3 for ; Wed, 12 Feb 2014 09:16:08 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id kq14sf20214314pab.9 for ; Wed, 12 Feb 2014 01:16:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=1xOdGY3IbCkWXmYYnGFz8lIe5fSI98GJWr+BYMpyjGc=; b=PRm5tEoB42dTWbEEAMjsIvF25/6bXwyx6UQdyYn9IG9iROCWbmHw6o1DkN3k6us9dl tETov8U7+LFZ5gZPWNYuPXCTa7kqMKe8qdfX4RFcTzFdPrvOWbzXBIgTcCj8hmapOobf 9z9pZTuzSUzOiWh1jDrXRW8rgRuszzo18Xvpqa/S1tQC6rD2blHbO8xzidXatqt+k8Da I8KznVoxW4iubCKa26u/q95HxbxPezYxpryCOzDSIHk9u9+kix4eVqbM7Z80xdel4Lor Qig11Lq5RbhDc0Je7CHH8hK0c9mcQwttHwcF0CGAwWGz4gDWCclRk6lFLjIEurFuPABj BGrg== X-Gm-Message-State: ALoCoQkYM8TAbitCwDFdqSjrn9G5Bs9xPgywcx6L2WeZj1Jn6SRi99UDWsuNhRXssb6TuIiypCO0 X-Received: by 10.68.201.134 with SMTP id ka6mr1353510pbc.4.1392196567555; Wed, 12 Feb 2014 01:16:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.200 with SMTP id j66ls2814659qgj.80.gmail; Wed, 12 Feb 2014 01:16:07 -0800 (PST) X-Received: by 10.52.232.168 with SMTP id tp8mr101765vdc.38.1392196567400; Wed, 12 Feb 2014 01:16:07 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id yv5si7093151veb.26.2014.02.12.01.16.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 01:16:07 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so6997516veb.21 for ; Wed, 12 Feb 2014 01:16:07 -0800 (PST) X-Received: by 10.52.244.102 with SMTP id xf6mr97966vdc.42.1392196567314; Wed, 12 Feb 2014 01:16:07 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp21694vcz; Wed, 12 Feb 2014 01:16:06 -0800 (PST) X-Received: by 10.68.0.35 with SMTP id 3mr49539000pbb.52.1392196565217; Wed, 12 Feb 2014 01:16:05 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qx4si22026057pbc.135.2014.02.12.01.16.02; Wed, 12 Feb 2014 01:16:02 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751935AbaBLJPx (ORCPT + 27 others); Wed, 12 Feb 2014 04:15:53 -0500 Received: from mail-pb0-f53.google.com ([209.85.160.53]:41616 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823AbaBLJPi (ORCPT ); Wed, 12 Feb 2014 04:15:38 -0500 Received: by mail-pb0-f53.google.com with SMTP id md12so8951223pbc.40 for ; Wed, 12 Feb 2014 01:15:38 -0800 (PST) X-Received: by 10.68.12.74 with SMTP id w10mr50574003pbb.39.1392196538054; Wed, 12 Feb 2014 01:15:38 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id bc4sm61451683pbb.2.2014.02.12.01.15.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 01:15:36 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, sachin.kamat@linaro.org, Linus Walleij Subject: [PATCH 4/4] mfd: stw481x: Check the return value of devm_regmap_init_i2c Date: Wed, 12 Feb 2014 14:40:13 +0530 Message-Id: <1392196213-20576-4-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392196213-20576-1-git-send-email-sachin.kamat@linaro.org> References: <1392196213-20576-1-git-send-email-sachin.kamat@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , devm_regmap_init_i2c can fail. Check for it. Signed-off-by: Sachin Kamat Cc: Linus Walleij --- drivers/mfd/stw481x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mfd/stw481x.c b/drivers/mfd/stw481x.c index cc42f88586f6..7ceb3df09e25 100644 --- a/drivers/mfd/stw481x.c +++ b/drivers/mfd/stw481x.c @@ -186,6 +186,12 @@ static int stw481x_probe(struct i2c_client *client, i2c_set_clientdata(client, stw481x); stw481x->client = client; stw481x->map = devm_regmap_init_i2c(client, &stw481x_regmap_config); + if (IS_ERR(stw481x->map)) { + ret = PTR_ERR(stw481x->map); + dev_err(&client->dev, "Failed to allocate register map: %d\n", + ret); + return ret; + } ret = stw481x_startup(stw481x); if (ret) {