From patchwork Thu Mar 21 15:59:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 2315081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 94016400E6 for ; Thu, 21 Mar 2013 16:33:36 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UIiNc-00014m-2S; Thu, 21 Mar 2013 16:30:16 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UIhvc-0001S1-9G for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2013 16:01:25 +0000 Received: by mail-wg0-f49.google.com with SMTP id gg9so1951899wgb.4 for ; Thu, 21 Mar 2013 09:01:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=F9KYgxczrYEw4vaiXKZPK5VP455HbRDr2S4j8clSfFk=; b=RtSGGququ2xymlmmn3Xrt/dtj3KOHm/IW/sFUReENyb9i4JNFBbXf+j2Rw7rGOmWkR oTREFMgxet/tb/mhhoNOhfcfjPwuHEj0ehIJEUg/2A7GgvplGq/MWtvDEpG7QETsFxhC LmHDXNHaOnlfngu4e+7Kvizmh3IJinWZpLKO/KY/i0YsTAOvDGlQGbVrXtbRWkJMkSSz 1FN7A5JHvELBB7U4PePFjO6+KHQELmzw9+KC7NRZLw6v29L8olVDCiDK6nzcJvsZlD2x r7J+DqfPkmAQ+A1HCCQgSyYkEtxgpJyq4DPz8GJPA/YBbw7pOvh1JCdD7q1u4Qlvi5SF LOvg== X-Received: by 10.180.87.98 with SMTP id w2mr5633979wiz.30.1363881676879; Thu, 21 Mar 2013 09:01:16 -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 ESMTPS id h10sm6110847wic.8.2013.03.21.09.01.14 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:01:15 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Subject: [PATCH 37/46] regulator: ab8500-ext: Adapt regulator registration for newly changed API Date: Thu, 21 Mar 2013 15:59:34 +0000 Message-Id: <1363881583-15234-38-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363881583-15234-1-git-send-email-lee.jones@linaro.org> References: <1363881583-15234-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnIAYjm1KO1C2E2Rh+eb+k8odB/5pXGCm+reKMz+JAELzdS52wd3yaj710dntHJ/WTvyOxN X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130321_120121_380375_F508D960 X-CRM114-Status: GOOD ( 13.60 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Gabriel Fernandez , Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Gabriel Fernandez Instead of using a long list of arguments for registering a new regulator, the API has changed to accommodate a new structure which is to contain the necessary runtime configuration. This patch allows the external regulator to follow suit and continue to successfully register itself with the Regulator subsystem. Signed-off-by: Gabriel Fernandez Signed-off-by: Lee Jones Reviewed-by: Philippe LANGLAIS Reviewed-by: Linus WALLEIJ --- drivers/regulator/ab8500-ext.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index ce1830f..836b5de 100644 --- a/drivers/regulator/ab8500-ext.c +++ b/drivers/regulator/ab8500-ext.c @@ -369,6 +369,7 @@ int ab8500_ext_regulator_init(struct platform_device *pdev) struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); struct ab8500_platform_data *ppdata; struct ab8500_regulator_platform_data *pdata; + struct regulator_config config = { }; int i, err; if (!ab8500) { @@ -414,6 +415,10 @@ int ab8500_ext_regulator_init(struct platform_device *pdev) info->cfg = (struct ab8500_ext_regulator_cfg *) pdata->ext_regulator[i].driver_data; + config.dev = &pdev->dev; + config.init_data = &pdata->ext_regulator[i]; + config.driver_data = info; + if ((is_ab9540(ab8500)) || (is_ab8540(ab8500))) { if (info->desc.id == AB8500_EXT_SUPPLY1) info->desc.ops = &ab9540_ext_regulator_ops; @@ -426,8 +431,8 @@ int ab8500_ext_regulator_init(struct platform_device *pdev) } /* register regulator with framework */ - info->rdev = regulator_register(&info->desc, &pdev->dev, - &pdata->ext_regulator[i], info, NULL); + info->rdev = regulator_register(&info->desc, &config); + if (IS_ERR(info->rdev)) { err = PTR_ERR(info->rdev); dev_err(&pdev->dev, "failed to register regulator %s\n",