From patchwork Tue Jul 3 11:59:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1150791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 5FC0ADFF72 for ; Tue, 3 Jul 2012 12:05:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sm1mY-0003eF-PX; Tue, 03 Jul 2012 12:00:38 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sm1mD-0003ZB-MO for linux-arm-kernel@lists.infradead.org; Tue, 03 Jul 2012 12:00:20 +0000 Received: by wibhq4 with SMTP id hq4so3216394wib.0 for ; Tue, 03 Jul 2012 04:59:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=AlJ9GMQCNu50zK1l/3L3JRvHtbj6ftaTEeoA+v+P35k=; b=n75OxrsOk9ZFO7MaYz7luVFVYKXWsMLz44vZPTbIsbQF6d1LR/6oNg/0P43Vn664LR +OaJdtHBkNX+PetXgXPOmze3DcunyeIxatdTfDrRC6IIVJTezyQhG0kzacHCWWT9zCst TFYOaa7BhlG5E0r2CqGKa/sYfCmDSJztBGezRF4rPWnhTCGfdGGN1GIfhouPzRqwI48H d8DLvhuWmE4m10OOo5NdlZ+Blm3pJ7g+oDzP6RqbjnNpt+4suChizBCGEHAOAnmF6bZH QwhRrqOA1DFM3KrN8dentuIaeraoMA5/JE4RPv6fu4sVqE8iY7YbCiJZAyfw6rHrv3I5 Vn2Q== Received: by 10.180.86.226 with SMTP id s2mr31376338wiz.9.1341316793241; Tue, 03 Jul 2012 04:59:53 -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 fo7sm30586422wib.9.2012.07.03.04.59.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 04:59:52 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] mfd: Fix runtime warning caused by duplicate device registration Date: Tue, 3 Jul 2012 12:59:48 +0100 Message-Id: <1341316788-12730-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlBjH88uqQIyzc7p1VNxdhEc/5XIjhkl2iQJw8bfmqAnS02JgpXHbBHBTT2Uy3x3MDJUKz6 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.171 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-kernel@vger.kernel.org, Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de, sameo@linux.intel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We register the ab8500 as an MFD device from db8500 code during Device Tree boot in order to solve some limitations of DT. However, when Device Tree is not enabled, we still want to allow platform code to register the ab8500 in the normal way. Here we force MFD device registration of the ab8500 only when booting with Device Tree enabled. Solves this issue: WARNING: at fs/sysfs/dir.c:526 sysfs_add_one+0x88/0xb0() sysfs: cannot create duplicate filename '/bus/platform/devices/ab8500-core.0' Reported-by: Linus Walleij Signed-off-by: Lee Jones --- drivers/mfd/db8500-prcmu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 80def6c..4ec0ed1 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -2964,6 +2964,9 @@ static struct mfd_cell db8500_prcmu_devs[] = { .name = "cpufreq-u8500", .of_compatible = "stericsson,cpufreq-u8500", }, +}; + +static struct mfd_cell db8500_of_prcmu_devs[] = { { .name = "ab8500-core", .of_compatible = "stericsson,ab8500", @@ -3014,6 +3017,15 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev) return err; } + if (np) { + err = mfd_add_devices(&pdev->dev, 0, db8500_of_prcmu_devs, + ARRAY_SIZE(db8500_of_prcmu_devs), NULL, 0); + if (err) { + pr_err("prcmu: Failed to add DT subdevices\n"); + return err; + } + } + pr_info("DB8500 PRCMU initialized\n"); no_irq_return: