From patchwork Wed May 22 12:47:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 17091 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 59433238FE for ; Wed, 22 May 2013 12:48:55 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf2159817ghb.10 for ; Wed, 22 May 2013 05:48:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=llxboomiDhJnfJurpWEYNAxNJuo+T1q/ncFBsij+JQk=; b=STdYfzf2uYMzuDFjqN9pizXsaeIbF+aoIQdd9CUMB9WyqcAtF27Qk5U/IiIyV2YB/F +n+7w25BF8a/CPyosv4+yY+cOqu3ICyVNgXaqb+5yx2rQDpaYN60l3rMDQHrsg4fQSHI IRCP2hcJErFw+FqMTphlV1fyKXj16GbCwSaXY26E2KdGq+atLtpcB8b0nHagEHuylBK6 iuZLwmPxoDYDaW0MKW4F3BnMH2ctsctCGrfXsYW10lq5ggUP3YI+mjmfPblxQ7SJNgHb tKTMpTZE5tjTi/w17Io3QMtJLu6CVp1/4xQ+NLUoHqpb61d80iCPv4ViKMCxg6F8IRWM MHOA== X-Received: by 10.236.152.165 with SMTP id d25mr3685307yhk.36.1369226882434; Wed, 22 May 2013 05:48:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.86.202 with SMTP id r10ls804581qez.86.gmail; Wed, 22 May 2013 05:48:02 -0700 (PDT) X-Received: by 10.220.11.1 with SMTP id r1mr2757386vcr.14.1369226882296; Wed, 22 May 2013 05:48:02 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id w7si3555550vci.49.2013.05.22.05.48.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 May 2013 05:48:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.176; Received: by mail-vc0-f176.google.com with SMTP id ha11so1260597vcb.21 for ; Wed, 22 May 2013 05:48:02 -0700 (PDT) X-Received: by 10.220.238.4 with SMTP id kq4mr2723982vcb.73.1369226882146; Wed, 22 May 2013 05:48:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.126.138 with SMTP id c10csp824vcs; Wed, 22 May 2013 05:48:01 -0700 (PDT) X-Received: by 10.180.205.200 with SMTP id li8mr14687931wic.15.1369226881118; Wed, 22 May 2013 05:48:01 -0700 (PDT) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [2a00:1450:400c:c00::234]) by mx.google.com with ESMTPS id ev14si5002369wid.53.2013.05.22.05.48.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 May 2013 05:48:01 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::234 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::234; Received: by mail-wg0-f52.google.com with SMTP id z11so1197320wgg.19 for ; Wed, 22 May 2013 05:48:00 -0700 (PDT) X-Received: by 10.180.74.172 with SMTP id u12mr33192837wiv.0.1369226880617; Wed, 22 May 2013 05:48:00 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id h8sm10615271wiz.9.2013.05.22.05.47.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 May 2013 05:47:59 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@kernel.org, linus.walleij@linaro.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones Subject: [PATCH] regulator: ab8500-ext: Don't register without initialisation data Date: Wed, 22 May 2013 13:47:33 +0100 Message-Id: <1369226853-16978-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369226853-16978-1-git-send-email-lee.jones@linaro.org> References: <1369226853-16978-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQke5fnNdYmKD5hVUldRrWm0AOdvZ4PHzyRdtD1xbsqY16YRdM09xGzgS/gBaDYvHAg4OH8N X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch fixes a bug introduced in the v3.10 merge window. Some platforms will not want external registers. Rather than setting up lots of different clauses in the core ab8500 regulator driver not to call ab8500-ext init() we just won't pass the initialisation data from platform code. This patch checks for it and if it's missing, we won't register the external regulators. Cc: Mark Brown Signed-off-by: Lee Jones --- drivers/regulator/ab8500-ext.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index b4d4547..8421537 100644 --- a/drivers/regulator/ab8500-ext.c +++ b/drivers/regulator/ab8500-ext.c @@ -334,6 +334,12 @@ int ab8500_ext_regulator_init(struct platform_device *pdev) return -EINVAL; } + /* have any external regulators been specified? */ + if (pdata->num_ext_regulator == 0) { + dev_warn(&pdev->dev, "Not using external regulators\n"); + return 0; + } + /* make sure the platform data has the correct size */ if (pdata->num_ext_regulator != ARRAY_SIZE(ab8500_ext_regulator_info)) { dev_err(&pdev->dev, "Configuration error: size mismatch.\n");