From patchwork Mon Feb 4 11:54:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14515 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 6F08323F96 for ; Mon, 4 Feb 2013 11:58:03 +0000 (UTC) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by fiordland.canonical.com (Postfix) with ESMTP id 123BCA1942F for ; Mon, 4 Feb 2013 11:58:02 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id fy27so3801941vcb.21 for ; Mon, 04 Feb 2013 03:58:02 -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=OZ5V7myjCLXPQPdOM+Vx32DST7WIjM/6CBa1zAvrQ3oIeoON6zQuX4zRtaartc3J2G RnUzlBgGoX7DZ8kgnlJS1jHDltOGyvUahpSo9y91DhmKF9VBOoS7QFyVAKArKk/OfTBT jciQMTaKkULz/nKWgKSSudtBHVSq8CrmOC/ajXWGnJ+g2oVRiXVFjloK97Wovj6exOTj r4tmj9G6R7sy7R4Zq/G8UusRpJty0d8tygjV91fv6GSD84kH0FUlU8AVoJfZm0YE399v 8u+ATrbD6d7iLXHVdjgC0zOXLcrErjUK/pTXDzQbs0sTTbHUDiiXd1ojlbtmfw0pxMpx 2xqg== X-Received: by 10.52.21.146 with SMTP id v18mr18933959vde.79.1359979082589; Mon, 04 Feb 2013 03:58:02 -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 zo8csp83137vec; Mon, 4 Feb 2013 03:58:02 -0800 (PST) X-Received: by 10.180.77.68 with SMTP id q4mr9955928wiw.10.1359979081724; Mon, 04 Feb 2013 03:58:01 -0800 (PST) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by mx.google.com with ESMTPS id r1si3468337wif.82.2013.02.04.03.58.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:58:01 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.45 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.45 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-wg0-f45.google.com with SMTP id dq12so4753800wgb.24 for ; Mon, 04 Feb 2013 03:58:01 -0800 (PST) X-Received: by 10.194.156.170 with SMTP id wf10mr16471955wjb.25.1359979080994; Mon, 04 Feb 2013 03:58:00 -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 j9sm12937128wia.5.2013.02.04.03.57.58 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:57:59 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Gabriel Fernandez , Lee Jones Subject: [PATCH 66/73] regulator: ab8500-ext: Adapt regulator registration for newly changed API Date: Mon, 4 Feb 2013 11:54:21 +0000 Message-Id: <1359978868-28736-67-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> References: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmd8Mqv8FUOC7aTyqDs0sf2IVVWxT4B/304z8echJymCas2JaVs8mtiFaW1biC9vlYVGn+a 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",