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: 9786 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 B958D23E2F for ; Tue, 3 Jul 2012 11:59:56 +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 7F587A183D4 for ; Tue, 3 Jul 2012 11:59:56 +0000 (UTC) Received: by ggnf1 with SMTP id f1so5586936ggn.11 for ; Tue, 03 Jul 2012 04:59:56 -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:x-gm-message-state; bh=AlJ9GMQCNu50zK1l/3L3JRvHtbj6ftaTEeoA+v+P35k=; b=ddscCCWziRiqX8+CCOmyKp1xZUk7ClHGKUHjl8k1NXJZPDROVoo5rk9p9UvWTgJlx6 eooeIpWHuWZQC11g8cTQ/BY/wF9ukt4QIAk4+PL2MEhjk1XRckmsYdIqCKk2osYKpwOY F0Qkm4qZHKzaPIvqhghAVKEFK3QSPgypWRi0CM664SpECa5Agqyo7adg8l4VvcAlnjB+ eQAkCbStSQbIUJV5J2VljVKfTv0IGNR1huk34MQYAKREEk7s5pyn8ux/INQZNhKr4ZU8 h9mxZkEiFPi3xDKdDeMu8E5qi0Hz1E61rleP07E7HdVKPK7+Z5fy6zb1LnawsCTkAGsm ywYg== Received: by 10.50.163.99 with SMTP id yh3mr7878457igb.53.1341316795790; Tue, 03 Jul 2012 04:59:55 -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 v20csp38775ibb; Tue, 3 Jul 2012 04:59:54 -0700 (PDT) Received: by 10.216.131.22 with SMTP id l22mr2637215wei.96.1341316793862; Tue, 03 Jul 2012 04:59:53 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id d3si28202380wie.4.2012.07.03.04.59.53 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 04:59:53 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.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 werf13 with SMTP id f13so5585344wer.37 for ; Tue, 03 Jul 2012 04:59:53 -0700 (PDT) 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 Cc: linus.walleij@stericsson.com, arnd@arndb.de, sameo@linux.intel.com, linux-kernel@vger.kernel.org, Lee Jones 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: ALoCoQl4EtWPhr4lnqPIOAzYcadQve1wLLLyG/zQDQjooqaFSP3V81GL9G/CN3cEPbbCG72lds2p 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: