Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2016231ybz; Thu, 30 Apr 2020 09:22:42 -0700 (PDT) X-Google-Smtp-Source: APiQypKQ6fnaoDKeYz9fCzq972qxj5HkpO7wURE2Nri3eRhfZF//nsLCVmnAKl0ivDSBhKftLkYx X-Received: by 2002:a05:6402:1b08:: with SMTP id by8mr3457581edb.286.1588263761853; Thu, 30 Apr 2020 09:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588263761; cv=none; d=google.com; s=arc-20160816; b=GUc28pAMa0zz9LTrPM3gJGccsGHuX4RSPGUOxotquAnMPFYgzWlkR928w2gcQxE4WN ZT1CIA2nWT+DUFzIpo9N+WCTym/qfS3AKFlj2IeY/88W7sNcn3cYh9mvJGJQa6lUlEZ4 GgMhZJzVQ4g9RBJ7iV1H8UY+mkELghD2pj5c4u++0BdYixNqDfSzzsPIC5J9OX1cifbS FUMC+rJNjfbjFINXkPrYVvwchL6INIHoEKTY8xaoumZErqnAAJJgGLLszPpZaUBiMnr8 TFFl++RJJXqfG9+rzZrjOulVAcaIau5sZJAO7W2mPe+Kl4WDGfHxrVQMT3GrlEOawVkM Rbiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=8npCPJJdX6lm1F8k+Amyhjt7X3QspyAcbSPXdyreCI0=; b=kR62z2Xa+UJplLq9AMC35PNGyLqKfINX8bjF0Sg5Dg3qq7NyFuvm9ZnG3u2nmyZpHK 9AuU7AE7bhWExJIx0ww+L/1QdxLH/XAnsiituIjysGWQzC4yX6nZoFYpK1K1+P+kybdP P/t75oKMEnuG8xScqz8C26Ga/hk20O+sHZQKoJ8VMvs3ZFHqLeIkpiJZkIvUo716ztKl a5+vEGmClZLcDWiLS3tIASdfxXow2DTOma7p3cQQkI26598lqF812z4eqVOiQ0l4q1dY lss1pWBYsy5NrjY6G2r/VHq+CZ8cF9BTmiUmQpyqkxiG01S6ZdafijcBSrqd1uDZ5UP8 RZCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg16si64093ejb.310.2020.04.30.09.22.18; Thu, 30 Apr 2020 09:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728449AbgD3QTv (ORCPT + 99 others); Thu, 30 Apr 2020 12:19:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:56094 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728121AbgD3QTr (ORCPT ); Thu, 30 Apr 2020 12:19:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 68804ACC4; Thu, 30 Apr 2020 16:19:43 +0000 (UTC) Message-ID: <0f7f2350cebdbd6904274e6a4e8da6e0a6c72102.camel@suse.de> Subject: Re: [PATCH v2 05/91] clk: bcm: rpi: Allow the driver to be probed by DT From: Nicolas Saenz Julienne To: Maxime Ripard , Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Date: Thu, 30 Apr 2020 18:19:41 +0200 In-Reply-To: <0f5319caa4d1b9ba8a83a094abcb681d4be6eb1c.1587742492.git-series.maxime@cerno.tech> References: <0f5319caa4d1b9ba8a83a094abcb681d4be6eb1c.1587742492.git-series.maxime@cerno.tech> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-q7dZwA3wemW7oWhPS4wd" User-Agent: Evolution 3.36.2 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-q7dZwA3wemW7oWhPS4wd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2020-04-24 at 17:33 +0200, Maxime Ripard wrote: > The current firmware clock driver for the RaspberryPi can only be probed = by > manually registering an associated platform_device. >=20 > While this works fine for cpufreq where the device gets attached a clkdev > lookup, it would be tedious to maintain a table of all the devices using > one of the clocks exposed by the firmware. >=20 > Since the DT on the other hand is the perfect place to store those > associations, make the firmware clocks driver probe-able through the devi= ce > tree so that we can represent it as a node. >=20 > Cc: Michael Turquette > Cc: Stephen Boyd > Cc: linux-clk@vger.kernel.org > Signed-off-by: Maxime Ripard > --- > drivers/clk/bcm/clk-raspberrypi.c | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk- > raspberrypi.c > index 1654fd0eedc9..aedeaaf2f66b 100644 > --- a/drivers/clk/bcm/clk-raspberrypi.c > +++ b/drivers/clk/bcm/clk-raspberrypi.c > @@ -255,15 +255,22 @@ static int raspberrypi_clk_probe(struct platform_de= vice > *pdev) > struct raspberrypi_clk *rpi; > int ret; > =20 > - firmware_node =3D of_find_compatible_node(NULL, NULL, > - "raspberrypi,bcm2835-firmware"); > + /* > + * We can be probed either through the an old-fashioned > + * platform device registration or through a DT node that is a > + * child of the firmware node. Handle both cases. > + */ > + if (dev->of_node) > + firmware_node =3D of_get_parent(dev->of_node); > + else > + firmware_node =3D of_find_compatible_node(NULL, NULL, > + "raspberrypi,bcm2835- > firmware"); > if (!firmware_node) { > dev_err(dev, "Missing firmware node\n"); > return -ENOENT; > } > =20 > firmware =3D rpi_firmware_get(firmware_node); > - of_node_put(firmware_node); Why remove this? I think it's still needed after your changes. Regards, Nicolas --=-q7dZwA3wemW7oWhPS4wd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl6q+p0ACgkQlfZmHno8 x/5Aewf/fIRt353bQjRQPXHvnCWvme3juReNuol1emq3w4qxjIbYk/3z6mE5Xqik N6cAGO+Hf35L5nhpW9qXpVTT3vbylYXIZ/OW5weQzIN+oKmUvJh+7FUwzl790OiU y2LJVs53mnmGErmkoTOkyoJNmDeft+FMuQ+105YbheOsgDY3XKDscjlwQgsk/Vx7 /ELAtNxaNwm0lU2V6TfIgDaIDysRbkao9DtA1c97wG1O6lZAanouAfuIFR+8+xrz AYKm8KnHJXi4wRSh2BAjm0e3qX+/RaI9RNeT7Xq68tsLl4jbz673IXTuyETjVc0s Csb4+I6CCUbczBNHzKUO2UntZvTpdQ== =fDu0 -----END PGP SIGNATURE----- --=-q7dZwA3wemW7oWhPS4wd--