From patchwork Tue Nov 4 10:45:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 40112 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 34C4E240A6 for ; Tue, 4 Nov 2014 10:46:02 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id h11sf3817879wiw.11 for ; Tue, 04 Nov 2014 02:46:01 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=qGh5f+u3QajfMojw0o15GsBjcjFu79H8iz3fyaiEbhA=; b=TuEtUZFLxMFXpem6yKAB/x3eqVTMxlf6+d/xkR8Rv29NbZbvvVfh3s80ifbfVzPsV+ R9Uf5qFvzv/IJlphBR+VmrfURhun2UNrZG+sih72UgtJujw9JtKtOtWHsEhKFlM0oWqb UtBjwClMAJ/6EXdtiZ9gGdXDpgBBV9BWvTuLdZJrAU0Vs/B8BwPbxHWssNzKnL5leCaE 0aV19vGW5/Pr/U7ikiIfQBkO3DZ/sWBXWZHBdkA8CdPlRIpJeoGgdK0lItQQ2F6Qg1Ur BeLfI+XvYPbSq/W7H83O7Sr7Z08z9fJv3lcY6MIIQdDKPNLOI8scpwCwZYg3KJNVkqNE ROTw== X-Gm-Message-State: ALoCoQl9GcyeUXEgUYi4Uny/sLsDl/cqbEz/1K20w3OxXW9ecztKnuMjU4Rc0RzfidG2SNUbpHDP X-Received: by 10.112.119.194 with SMTP id kw2mr346997lbb.16.1415097961392; Tue, 04 Nov 2014 02:46:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.100 with SMTP id z4ls852752laz.60.gmail; Tue, 04 Nov 2014 02:46:01 -0800 (PST) X-Received: by 10.112.167.130 with SMTP id zo2mr58221418lbb.4.1415097961201; Tue, 04 Nov 2014 02:46:01 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id z7si140030lag.18.2014.11.04.02.46.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 02:46:00 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id n15so689580lbi.32 for ; Tue, 04 Nov 2014 02:46:00 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr22526972lbo.32.1415097960707; Tue, 04 Nov 2014 02:46:00 -0800 (PST) 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.112.184.201 with SMTP id ew9csp95333lbc; Tue, 4 Nov 2014 02:45:59 -0800 (PST) X-Received: by 10.70.89.167 with SMTP id bp7mr7550858pdb.144.1415097959022; Tue, 04 Nov 2014 02:45:59 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si72187pdn.5.2014.11.04.02.45.58 for ; Tue, 04 Nov 2014 02:45:59 -0800 (PST) Received-SPF: none (google.com: linux-kernel-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 S1753203AbaKDKp4 (ORCPT + 25 others); Tue, 4 Nov 2014 05:45:56 -0500 Received: from mail-wg0-f48.google.com ([74.125.82.48]:62341 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753174AbaKDKpv (ORCPT ); Tue, 4 Nov 2014 05:45:51 -0500 Received: by mail-wg0-f48.google.com with SMTP id m15so7769259wgh.7 for ; Tue, 04 Nov 2014 02:45:49 -0800 (PST) X-Received: by 10.180.73.45 with SMTP id i13mr16064297wiv.32.1415097949830; Tue, 04 Nov 2014 02:45:49 -0800 (PST) Received: from trevor.secretlab.ca (host81-159-9-229.range81-159.btcentralplus.com. [81.159.9.229]) by mx.google.com with ESMTPSA id vq1sm69647wjc.29.2014.11.04.02.45.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Nov 2014 02:45:48 -0800 (PST) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id 9BE39C409C2; Tue, 4 Nov 2014 10:45:34 +0000 (GMT) From: Grant Likely To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: Grant Likely , Rob Herring , Arnd Bergmann , Greg Kroah-Hartman , Benjamin Herrenschmidt Subject: [PATCH] of/platform: Move platform devices under /sys/devices/platform Date: Tue, 4 Nov 2014 10:45:20 +0000 Message-Id: <1415097920-30014-1-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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.217.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: , Currently the devices created by drivers/of/platform.c get created at the root of /sys/devices. This goes against the typical pattern for sysfs where the top level /sys/devices structure contains categories of devices, and the structure of devices is placed below that. To fix this, make the code in drivers/of/platform.c follow the drivers/base/platform.c behaviour, and use &platform_bus as the default parent for all new platform_devices and amba_devices. This change has been discussed for a long time, but nobody has actually acted on it. Userspace code that expects to find devices under a fixed /sys/devices/... path will be affected. It isn't /supposed/ to do that, but if anyone complains then I'll add a default-off workaround option to put them back into the root. Signed-off-by: Grant Likely Cc: Rob Herring Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Benjamin Herrenschmidt Acked-by: Greg Kroah-Hartman --- drivers/of/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 3b64d0bf5bba..7c6771986c06 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -138,7 +138,7 @@ struct platform_device *of_device_alloc(struct device_node *np, } dev->dev.of_node = of_node_get(np); - dev->dev.parent = parent; + dev->dev.parent = parent ? : &platform_bus; if (bus_id) dev_set_name(&dev->dev, "%s", bus_id); @@ -291,7 +291,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node, /* setup generic device info */ dev->dev.of_node = of_node_get(node); - dev->dev.parent = parent; + dev->dev.parent = parent ? : &platform_bus; dev->dev.platform_data = platform_data; if (bus_id) dev_set_name(&dev->dev, "%s", bus_id);