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: 15511 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DE6B023E14 for ; Thu, 21 Mar 2013 16:01:19 +0000 (UTC) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by fiordland.canonical.com (Postfix) with ESMTP id 1A29BA19E72 for ; Thu, 21 Mar 2013 16:01:19 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fr13so2020687vbb.17 for ; Thu, 21 Mar 2013 09:01:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=F9KYgxczrYEw4vaiXKZPK5VP455HbRDr2S4j8clSfFk=; b=LImuQWrz6DYmDe4WOxputYuAlcPnfIaeCbUXgZfM32cKsIBXRKjshOBPmPNB4nVF5F 1hRGkgThdQmGjBfHQwVkGJ/36dc0Z6KkcDjaKUVzhrLt93SFp03u1rrb6LsFnEG1oFJx ToWHvP5Hl0dey/YRcLJV5liss8rbTU95jlsG7rUIMRae/Lle3SCiS/0EMv3k9MyJQuXm FAFG+O8gzBlmDQa0/XS6BW+jn4wRO81st/arsQBB1dzB9yshirc8aNqfeN65C/wJGTXP aDY04gvlwx5JQ6XCbPHAc9yzqMFK2a+Aq5yNeifAYvSKeGqmBfFBNO2I9eZJuW4NcqYP qqHA== X-Received: by 10.58.29.101 with SMTP id j5mr14272115veh.26.1363881678426; Thu, 21 Mar 2013 09:01:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.233.198 with SMTP id ty6csp66826vec; Thu, 21 Mar 2013 09:01:17 -0700 (PDT) X-Received: by 10.194.133.198 with SMTP id pe6mr18318272wjb.9.1363881677479; Thu, 21 Mar 2013 09:01:17 -0700 (PDT) Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]) by mx.google.com with ESMTPS id lm7si922130wjb.148.2013.03.21.09.01.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:01:17 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::235 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::235; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::235 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f181.google.com with SMTP id hm6so3275304wib.14 for ; Thu, 21 Mar 2013 09:01:17 -0700 (PDT) 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 Cc: arnd@arndb.de, linus.walleij@stericsson.com, Gabriel Fernandez , Lee Jones 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: ALoCoQneVo6BgcvPV0HDsyAMQESYoZehGoCzthdDEc+T4ptoZhYxezVV1D/48aAdYkmW45gxidvX 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",