From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933631AbeALM4s (ORCPT + 1 other); Fri, 12 Jan 2018 07:56:48 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:46790 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933357AbeALM4q (ORCPT ); Fri, 12 Jan 2018 07:56:46 -0500 X-Google-Smtp-Source: ACJfBouyKFFNooMjQI8zukgpWMue6V9yljXuCb4pvGjZ7EtKUBtO+stMyOq9/3t8DoqcT0h8zunZfg== Date: Fri, 12 Jan 2018 13:56:43 +0100 From: Thierry Reding To: Sudeep Holla Cc: Brian Norris , Gregory Fong , Florian Fainelli , arm@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] soc: brcmstb: Only register SoC device on STB platforms Message-ID: <20180112125643.GA19999@ulmo> References: <20180109145409.11612-1-thierry.reding@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 12, 2018 at 11:39:30AM +0000, Sudeep Holla wrote: >=20 >=20 > On 09/01/18 14:54, Thierry Reding wrote: > > From: Thierry Reding > >=20 > > After moving the SoC device initialization to an early initcall in > > commit f780429adfbc ("soc: brcmstb: biuctrl: Move to early_initcall"), > > the Broadcom STB SoC device is registered on all platforms if support > > for the device is enabled in the kernel configuration. > >=20 > > This causes an additional SoC device to appear on platforms that already > > register a native one. In case of Tegra the STB SoC device is registered > > as soc0 (with totally meaningless content in the sysfs attributes) and > > causes various scripts and programs to fail because they don't know how > > to parse that data. > >=20 > > To fix this, duplicate the check from brcmstb_soc_device_early_init() > > that already prevents the code from doing anything nonsensical on non- > > STB platforms. > >=20 > > Fixes: f780429adfbc ("soc: brcmstb: biuctrl: Move to early_initcall") > > Signed-off-by: Thierry Reding > > --- > > drivers/soc/bcm/brcmstb/common.c | 5 +++++ > > 1 file changed, 5 insertions(+) > >=20 > > diff --git a/drivers/soc/bcm/brcmstb/common.c b/drivers/soc/bcm/brcmstb= /common.c > > index 781ada62d0a3..4fe1cb73b39a 100644 > > --- a/drivers/soc/bcm/brcmstb/common.c > > +++ b/drivers/soc/bcm/brcmstb/common.c > > @@ -89,8 +89,13 @@ early_initcall(brcmstb_soc_device_early_init); > > static int __init brcmstb_soc_device_init(void) > > { > > struct soc_device_attribute *soc_dev_attr; > > + struct device_node *sun_top_ctrl; > > struct soc_device *soc_dev; > > =20 > > + sun_top_ctrl =3D of_find_matching_node(NULL, sun_top_ctrl_match); > > + if (!sun_top_ctrl) > > + return -ENODEV; > > + >=20 > missing of_node_put(sun_top_ctrl) ? or am I missing to see that elsewhere= ? Hm... you're right. I was blindly copying this from brcmstb_soc_device_early() which doesn't have the of_node_put() either. Let me fix this up with another couple of patches. Thanks, Thierry --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlpYsIgACgkQ3SOs138+ s6FV0BAAiMshKHo2m/HU0yKqrxw0NhWoaSVODjmFD4j0NIMS41spo26bRyE7uiWg c0E+mUCCP4cNc9qXZ5a5+LjOKpcEcOJNVhzDPlMJn3ECN+q5J2DkhnY0VE6hD7vB 7ib0EyOOlBk8PaBsWMpyfz99146Af8gVdTaZ8Fd11BLHOIC5MVX2BZT1AsM56wgh GjCixiaMTQRngIutSbsrk2+zKqbqNSMjmARSbeaoONWLqu6ey818pO/41JRNELIB EXNesfhdf5BxQ4ps/LDYoX7OuFSM/t7pziJkWJRfNoOmr77Gd+voQPIUnudZRq/+ QzkX7isjT0vZDyHnayhBSRZxKia8VK7AqJe87LC/Fj9zo7UuwGwaBA9W5AFhVgfj YUG+HYC1oLak26fDZHvoshXq6eIv2diF27PNO9YXIT0lVcJvbaXTkRttHuQ5A9Zq 3tZKfWrPKU84Xi5uikq/MtxumT9gihWcHa7aBGImNtwDfKKy2Kb1FZ5UbCnAoMp6 0jP/zVLMn1uljNFzSQTl5crEm3dyAt5d9tgDGl9gZaNDhtORzy8KR+8nOqyJ0n75 gcj/7ffeykIBQ7FFrKLd+xRo8LaMn7pT+NiO4WZDFb4GLAN++ceC8W1+YIYP+1bT MevClC6Nl5ImaR5OyFjyfN+teOXinfz1K6U7PVephkbzUrn/EIc= =8m1n -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--