From patchwork Thu May 22 23:36:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 30775 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C6362066E for ; Fri, 23 May 2014 12:57:23 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id l6sf23038017oag.11 for ; Fri, 23 May 2014 05:57:22 -0700 (PDT) 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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=w8EKla3B4RRnX88+vX3OMav7Pc5gOE65ky8Y7oxAOmc=; b=kECLXtYSEmB9jxnhM2sENE9T5VJyHF/YJGVPOoT3ET9qnSjlyi6WCAgSlwL3pAJCDv DutEqU79tJZMbX5/jVf0elyRCmGDoAdkKyskebriuDEZ/9u/gAnrGp/NUwq0a10AiD7h v4edMnm5sQP/ctgS78S8VSFaWSJufTM6Y1rot7OdKKvYKkXNiXL+pmUsTXtPMkgvc7RF CSd61JiV19HO/uolLb9o2wA2PD6LHEQ0K1n29ibAyEn5X/LPkWrfKD44ibP4N9jHIHci 9B/ZXX+Jb+eJPIGpVtGXRgF3XdEkG2oEmtX2ZM44p9EkIaCUh8csBeNvjXvfSM9uvmny Ft5Q== X-Gm-Message-State: ALoCoQkrKkce37NYNi5r7aZTRqyrwbofDWbQSDuIOUjHgBcx8MtsVf2PM9IO0R1yLYJjSz3Y5bHa X-Received: by 10.182.125.4 with SMTP id mm4mr548963obb.49.1400849842905; Fri, 23 May 2014 05:57:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.99 with SMTP id y90ls1727047qgd.82.gmail; Fri, 23 May 2014 05:57:22 -0700 (PDT) X-Received: by 10.52.183.228 with SMTP id ep4mr3303203vdc.30.1400849842802; Fri, 23 May 2014 05:57:22 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id 6si1545771vct.68.2014.05.23.05.57.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 05:57:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id pa12so6156574veb.4 for ; Fri, 23 May 2014 05:57:22 -0700 (PDT) X-Received: by 10.58.185.165 with SMTP id fd5mr894966vec.41.1400849842722; Fri, 23 May 2014 05:57:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp29345vcb; Fri, 23 May 2014 05:57:22 -0700 (PDT) X-Received: by 10.67.1.39 with SMTP id bd7mr5828317pad.15.1400849841902; Fri, 23 May 2014 05:57:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tr4si3798352pbc.16.2014.05.23.05.57.21; Fri, 23 May 2014 05:57:21 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752463AbaEWM5T (ORCPT + 8 others); Fri, 23 May 2014 08:57:19 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:53107 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752373AbaEWMvL (ORCPT ); Fri, 23 May 2014 08:51:11 -0400 Received: by mail-wi0-f171.google.com with SMTP id cc10so782989wib.4 for ; Fri, 23 May 2014 05:51:10 -0700 (PDT) X-Received: by 10.180.108.146 with SMTP id hk18mr3145079wib.42.1400849470571; Fri, 23 May 2014 05:51:10 -0700 (PDT) Received: from trevor.secretlab.ca ([37.205.61.203]) by mx.google.com with ESMTPSA id s9sm2800291wix.13.2014.05.23.05.51.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 May 2014 05:51:06 -0700 (PDT) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id B7A85C41623; Fri, 23 May 2014 08:36:19 +0900 (JST) From: Grant Likely To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Grant Likely , Rob Herring , Benjamin Herrenschmidt Subject: [PATCH v2 2/2] of: Stop naming platform_device using dcr address Date: Fri, 23 May 2014 08:36:09 +0900 Message-Id: <1400801769-4506-3-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400801769-4506-1-git-send-email-grant.likely@linaro.org> References: <1400801769-4506-1-git-send-email-grant.likely@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grant.likely@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , There is now a way to ensure all platform devices get a unique name when populated from the device tree, and the DCR_NATIVE code path is broken anyway. PowerPC Cell (PS3) is the only platform that actually uses this path. Most likely nobody will notice if it is killed. Remove the code and associated ugly #ifdef. The user-visible impact of this patch is that any DCR device on Cell will get a new name in the /sys/devices hierarchy. Signed-off-by: Grant Likely Cc: Rob Herring Cc: Benjamin Herrenschmidt --- arch/powerpc/include/asm/dcr-mmio.h | 4 ---- arch/powerpc/sysdev/dcr.c | 6 +++--- drivers/of/platform.c | 24 ------------------------ 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/arch/powerpc/include/asm/dcr-mmio.h b/arch/powerpc/include/asm/dcr-mmio.h index acd491dbd45a..93a68b28e695 100644 --- a/arch/powerpc/include/asm/dcr-mmio.h +++ b/arch/powerpc/include/asm/dcr-mmio.h @@ -51,10 +51,6 @@ static inline void dcr_write_mmio(dcr_host_mmio_t host, out_be32(host.token + ((host.base + dcr_n) * host.stride), value); } -extern u64 of_translate_dcr_address(struct device_node *dev, - unsigned int dcr_n, - unsigned int *stride); - #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_DCR_MMIO_H */ diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c index 1bd0eba4d355..e9056e438575 100644 --- a/arch/powerpc/sysdev/dcr.c +++ b/arch/powerpc/sysdev/dcr.c @@ -152,9 +152,9 @@ EXPORT_SYMBOL_GPL(dcr_resource_len); #ifdef CONFIG_PPC_DCR_MMIO -u64 of_translate_dcr_address(struct device_node *dev, - unsigned int dcr_n, - unsigned int *out_stride) +static u64 of_translate_dcr_address(struct device_node *dev, + unsigned int dcr_n, + unsigned int *out_stride) { struct device_node *dp; const u32 *p; diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 95c133a0554b..52780a72d09d 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -51,10 +51,6 @@ struct platform_device *of_find_device_by_node(struct device_node *np) } EXPORT_SYMBOL(of_find_device_by_node); -#if defined(CONFIG_PPC_DCR) -#include -#endif - #ifdef CONFIG_OF_ADDRESS /* * The following routines scan a subtree and registers a device for @@ -78,26 +74,6 @@ void of_device_make_bus_id(struct device *dev) const __be32 *reg; u64 addr; -#ifdef CONFIG_PPC_DCR - /* - * If it's a DCR based device, use 'd' for native DCRs - * and 'D' for MMIO DCRs. - */ - reg = of_get_property(node, "dcr-reg", NULL); - if (reg) { -#ifdef CONFIG_PPC_DCR_NATIVE - dev_set_name(dev, "d%x.%s", *reg, node->name); -#else /* CONFIG_PPC_DCR_NATIVE */ - u64 addr = of_translate_dcr_address(node, *reg, NULL); - if (addr != OF_BAD_ADDR) { - dev_set_name(dev, "D%llx.%s", - (unsigned long long)addr, node->name); - return; - } -#endif /* !CONFIG_PPC_DCR_NATIVE */ - } -#endif /* CONFIG_PPC_DCR */ - /* Construct the name, using parent nodes if necessary to ensure uniqueness */ while (node->parent) { /*