From patchwork Wed Jun 20 12:56:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 9492 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 A850F23E1B for ; Wed, 20 Jun 2012 12:57:10 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 78046A1851B for ; Wed, 20 Jun 2012 12:57:10 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so6045762ggn.11 for ; Wed, 20 Jun 2012 05:57:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=+BkniVIHTe+aYzLC2qB2nHDdls6C5biE3HZ+oW95d34=; b=cbQsrfmEKjwURaEXcj2ONGs7TeIG3VnGCWB9kzE8NeTfsEfWVCSAFGCGw8spclY0kW X/CH30RuFndSC4qH3KE5D/7pczAkYTHoruTGMOkV7MS4ynjTL1gGZEdXuMn7gXfGtvVX JTMCNdXiDofO0CZBU+zCKmVgNmjmdbPEgMRL2oOi35tkqy4TRDBvz3erX6x2f7Efgr7f bHDqGG0OdHK97KVLZVAsqv7PQ/yIhOrUixd7M5yYl2Hi45hnj2tFrGdd9jY/85I8LU0y 7nFO1FAQQqMCYoqM7C7KvuHpHri9h45UE3FGSbMbKYXQS15Vc5lAnzUUBEICcW/XlWve ZwJA== Received: by 10.50.163.99 with SMTP id yh3mr4294399igb.53.1340197030039; Wed, 20 Jun 2012 05:57:10 -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.231.24.148 with SMTP id v20csp178535ibb; Wed, 20 Jun 2012 05:57:09 -0700 (PDT) Received: by 10.216.139.19 with SMTP id b19mr13113675wej.4.1340197028829; Wed, 20 Jun 2012 05:57:08 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id n3si34432531wix.5.2012.06.20.05.57.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 05:57:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by wibhn6 with SMTP id hn6so3387404wib.13 for ; Wed, 20 Jun 2012 05:57:08 -0700 (PDT) Received: by 10.180.102.36 with SMTP id fl4mr11963569wib.2.1340197028254; Wed, 20 Jun 2012 05:57:08 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id gc6sm38878374wib.0.2012.06.20.05.57.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 05:57:07 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org Cc: linus.walleij@stericsson.com, arnd@arndb.de, grant.likely@secretlab.ca, linux@arm.linux.org.uk, broonie@opensource.wolfsonmicro.com, Lee Jones , Samuel Ortiz Subject: [PATCH 05/15] mfd: db8500-prcmu: Register devices using the newly DT:ed MFD API Date: Wed, 20 Jun 2012 13:56:41 +0100 Message-Id: <1340197011-5435-6-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1340197011-5435-1-git-send-email-lee.jones@linaro.org> References: <1340197011-5435-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQl3rCRguTSCEnqLffu9a+bjO1Zrci58ytOoGcjteRUVSYD7TOcBnS/yLzY+ZDmJ0bnMvCO9 Now the MFD API is Device Tree aware we can use it for platform registration again, even when booting with DT enabled. To aid in Device Node pointer allocation we provide each cell with the associative compatible string. Cc: Samuel Ortiz Signed-off-by: Lee Jones --- drivers/mfd/db8500-prcmu.c | 14 +++++++------- drivers/regulator/db8500-prcmu.c | 6 ------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 1aa0bb7..e9e576c 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -2948,11 +2948,13 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = { static struct mfd_cell db8500_prcmu_devs[] = { { .name = "db8500-prcmu-regulators", + .of_compatible = "stericsson,db8500-prcmu-regulator", .platform_data = &db8500_regulators, .pdata_size = sizeof(db8500_regulators), }, { .name = "cpufreq-u8500", + .of_compatible = "stericsson,cpufreq-u8500", }, }; @@ -2990,13 +2992,11 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev) if (cpu_is_u8500v20_or_later()) prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET); - if (!np) { - err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, - ARRAY_SIZE(db8500_prcmu_devs), NULL, 0); - if (err) { - pr_err("prcmu: Failed to add subdevices\n"); - return err; - } + err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, + ARRAY_SIZE(db8500_prcmu_devs), NULL, 0); + if (err) { + pr_err("prcmu: Failed to add subdevices\n"); + return err; } pr_info("DB8500 PRCMU initialized\n"); diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c index 9dbb491..359f8d1 100644 --- a/drivers/regulator/db8500-prcmu.c +++ b/drivers/regulator/db8500-prcmu.c @@ -547,16 +547,10 @@ static int __exit db8500_regulator_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id db8500_prcmu_regulator_match[] = { - { .compatible = "stericsson,db8500-prcmu-regulator", }, - {} -}; - static struct platform_driver db8500_regulator_driver = { .driver = { .name = "db8500-prcmu-regulators", .owner = THIS_MODULE, - .of_match_table = db8500_prcmu_regulator_match, }, .probe = db8500_regulator_probe, .remove = __exit_p(db8500_regulator_remove),