From patchwork Wed Feb 6 10:54:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14622 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 2A8D82423C for ; Wed, 6 Feb 2013 10:56:10 +0000 (UTC) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by fiordland.canonical.com (Postfix) with ESMTP id D65F5A187B7 for ; Wed, 6 Feb 2013 10:56:09 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fl17so748694vcb.13 for ; Wed, 06 Feb 2013 02:56:09 -0800 (PST) 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=NZVfW1qO4sX1aI7XhcNuczEXwdvjiJimNyIApXKlbMI=; b=L35gD2yqIOh+vJGxm9wnMi8YzrsbDiTmIBWKQCJc4fOT1HC7pZO7K41dqjT4foyMBF Ngx+rpVhrU20WLhVVyrZNq2s/zfGFBupMQHJtxGrKR2TPkvJQTMQ8dPy0SgrHgB7+vq8 OCJPabJZ7mC5avHG+Od2HuWUFqHIbjUcbnBoaJz951Gd4/0ygIZMdllflBRxoMLQXgoB r2xlV6yQAGO3vxsZK+X/yVMaQ3IzZrWqSOg3VVQA3/VEtwbRja/s+KHZakgKqO2imgx4 8Qq3RXq81chaU4f3Bj78SMoZJeYslyajJxE1DRh/EbrLSmGxKNKzXNTChXLzYJ3xJb9B NF2g== X-Received: by 10.58.232.226 with SMTP id tr2mr28238148vec.48.1360148169156; Wed, 06 Feb 2013 02:56:09 -0800 (PST) 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.252.8 with SMTP id zo8csp13018vec; Wed, 6 Feb 2013 02:56:08 -0800 (PST) X-Received: by 10.194.5.74 with SMTP id q10mr49060821wjq.13.1360148120044; Wed, 06 Feb 2013 02:55:20 -0800 (PST) Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by mx.google.com with ESMTPS id a7si8552894wjb.113.2013.02.06.02.55.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:20 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22a is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22a; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c05::22a 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-f170.google.com with SMTP id hm11so6808332wib.5 for ; Wed, 06 Feb 2013 02:55:19 -0800 (PST) X-Received: by 10.194.122.98 with SMTP id lr2mr49136423wjb.7.1360148119619; Wed, 06 Feb 2013 02:55:19 -0800 (PST) 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 be1sm2406649wib.10.2013.02.06.02.55.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:19 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, linus.walleij@linaro.org, Gabriel Fernandez , Lee Jones Subject: [PATCH 43/49] regulator: ab8500-ext: Adapt regulator registration for newly changed API Date: Wed, 6 Feb 2013 10:54:05 +0000 Message-Id: <1360148051-7560-44-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360148051-7560-1-git-send-email-lee.jones@linaro.org> References: <1360148051-7560-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQm8/UUqYqrU9rLmo9DolW9EaEcneA4s16/JCRVUGYSnwzRdPyP3QI2w+aeKd82b44Ke/FgP 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",