From patchwork Tue Dec 3 14:08:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 21960 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2CCED202DA for ; Tue, 3 Dec 2013 14:08:35 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id md12sf38296807pbc.8 for ; Tue, 03 Dec 2013 06:08:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=HQjjY5U9vcDQqFQ8sdcAQYbAsu/N73MInIfRMF3KJTw=; b=CXmpePKYLX+HaKLzJH4A8pUBevAwobDPzkcGr51mJ84wZWj1pcUG4eBAMujsf78sdb kWRuW4YdWa0BB3DYbkHb8wtLSybVC9Ux0Q552C0BDu01htQCabtfh+eq0g2fINkBhu9Z 50DQJfn8W/BTyS9+GQEG76VKiWTMkH8anXzegw62Z1H48SS0WndtlcjOj1QLJ9MkrZZC NTtoHLsUhSkTNnmRiYQK/h/jYQtvP3tIx7L74P5TtpW9DcQLSINeKj+ehxtHG2lGiKQs ZBGrja8FNmC77BKvpPp9blZCrwR6eCLOLu+m2NZjHes5Y/FS7c7jqavBCFOMgkLJObSu x6PQ== X-Gm-Message-State: ALoCoQniAgYzDgAV79f7qNV4pcIIsvMXm1JUQuV5ZY8YXJhct+CcBogS7tMFEEY6qyOZY8tpaTKv X-Received: by 10.67.2.41 with SMTP id bl9mr26032591pad.16.1386079714495; Tue, 03 Dec 2013 06:08:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.131 with SMTP id lk3ls1133264qeb.59.gmail; Tue, 03 Dec 2013 06:08:34 -0800 (PST) X-Received: by 10.52.186.228 with SMTP id fn4mr4036407vdc.34.1386079714318; Tue, 03 Dec 2013 06:08:34 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id gq10si31322971vdc.17.2013.12.03.06.08.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 06:08:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so10283829veb.16 for ; Tue, 03 Dec 2013 06:08:34 -0800 (PST) X-Received: by 10.220.124.68 with SMTP id t4mr298030vcr.52.1386079713943; Tue, 03 Dec 2013 06:08:33 -0800 (PST) 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.174.196 with SMTP id u4csp210752vcz; Tue, 3 Dec 2013 06:08:33 -0800 (PST) X-Received: by 10.112.151.103 with SMTP id up7mr902876lbb.14.1386079712527; Tue, 03 Dec 2013 06:08:32 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by mx.google.com with ESMTPS id h4si21882002lam.161.2013.12.03.06.08.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 06:08:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.48 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id n7so8948169lam.21 for ; Tue, 03 Dec 2013 06:08:31 -0800 (PST) X-Received: by 10.152.28.161 with SMTP id c1mr3307646lah.24.1386079711853; Tue, 03 Dec 2013 06:08:31 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id e1sm27935072lbe.0.2013.12.03.06.08.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Dec 2013 06:08:31 -0800 (PST) From: Linus Walleij To: Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org Cc: Linus Walleij , Mark Brown , Lee Jones Subject: [PATCH] regulator: ab8500: delete non-devicetree probe path Date: Tue, 3 Dec 2013 15:08:22 +0100 Message-Id: <1386079702-22821-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 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: , The Ux500 platform has been converted to do device-tree only boots, no longer supports platform data passing, so this probe path is unused. Delete it, simplifying the driver a whole lot. Cc: Mark Brown Cc: Lee Jones Signed-off-by: Linus Walleij --- I tried to also delete this boot path for the external regulators in ab8500-ext.c, but it seems to not have been cleanly converted to device tree yet, making it dependent on passing some platform data still. Thus I cannot go down the path and delete all platform data down to the point where (most of) arch/arm/mach-ux500/board-mop500-regulator.[c|h] gets deleted, but I can do this much. --- drivers/regulator/ab8500.c | 102 ++++----------------------------------------- 1 file changed, 8 insertions(+), 94 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 603f192e84f1..0f86695b737a 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -2998,37 +2998,6 @@ static void abx500_get_regulator_info(struct ab8500 *ab8500) } } -static int ab8500_regulator_init_registers(struct platform_device *pdev, - int id, int mask, int value) -{ - struct ab8500_reg_init *reg_init = abx500_regulator.init; - int err; - - BUG_ON(value & ~mask); - BUG_ON(mask & ~reg_init[id].mask); - - /* initialize register */ - err = abx500_mask_and_set_register_interruptible( - &pdev->dev, - reg_init[id].bank, - reg_init[id].addr, - mask, value); - if (err < 0) { - dev_err(&pdev->dev, - "Failed to initialize 0x%02x, 0x%02x.\n", - reg_init[id].bank, - reg_init[id].addr); - return err; - } - dev_vdbg(&pdev->dev, - " init: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", - reg_init[id].bank, - reg_init[id].addr, - mask, value); - - return 0; -} - static int ab8500_regulator_register(struct platform_device *pdev, struct regulator_init_data *init_data, int id, struct device_node *np) @@ -3095,9 +3064,7 @@ static int ab8500_regulator_probe(struct platform_device *pdev) { struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); struct device_node *np = pdev->dev.of_node; - struct ab8500_platform_data *ppdata; - struct ab8500_regulator_platform_data *pdata; - int i, err; + int err; if (!ab8500) { dev_err(&pdev->dev, "null mfd parent\n"); @@ -3106,68 +3073,15 @@ static int ab8500_regulator_probe(struct platform_device *pdev) abx500_get_regulator_info(ab8500); - if (np) { - err = of_regulator_match(&pdev->dev, np, - abx500_regulator.match, - abx500_regulator.match_size); - if (err < 0) { - dev_err(&pdev->dev, - "Error parsing regulator init data: %d\n", err); - return err; - } - - err = ab8500_regulator_of_probe(pdev, np); - return err; - } - - ppdata = dev_get_platdata(ab8500->dev); - if (!ppdata) { - dev_err(&pdev->dev, "null parent pdata\n"); - return -EINVAL; - } - - pdata = ppdata->regulator; - if (!pdata) { - dev_err(&pdev->dev, "null pdata\n"); - return -EINVAL; - } - - /* make sure the platform data has the correct size */ - if (pdata->num_regulator != abx500_regulator.info_size) { - dev_err(&pdev->dev, "Configuration error: size mismatch.\n"); - return -EINVAL; - } - - /* initialize debug (initial state is recorded with this call) */ - err = ab8500_regulator_debug_init(pdev); - if (err) + err = of_regulator_match(&pdev->dev, np, + abx500_regulator.match, + abx500_regulator.match_size); + if (err < 0) { + dev_err(&pdev->dev, + "Error parsing regulator init data: %d\n", err); return err; - - /* initialize registers */ - for (i = 0; i < pdata->num_reg_init; i++) { - int id, mask, value; - - id = pdata->reg_init[i].id; - mask = pdata->reg_init[i].mask; - value = pdata->reg_init[i].value; - - /* check for configuration errors */ - BUG_ON(id >= abx500_regulator.init_size); - - err = ab8500_regulator_init_registers(pdev, id, mask, value); - if (err < 0) - return err; - } - - /* register all regulators */ - for (i = 0; i < abx500_regulator.info_size; i++) { - err = ab8500_regulator_register(pdev, &pdata->regulator[i], - i, NULL); - if (err < 0) - return err; } - - return 0; + return ab8500_regulator_of_probe(pdev, np); } static int ab8500_regulator_remove(struct platform_device *pdev)