From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4721AC47259 for ; Mon, 4 May 2020 17:12:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E97221835 for ; Mon, 4 May 2020 17:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730401AbgEDRMi (ORCPT ); Mon, 4 May 2020 13:12:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:57904 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730092AbgEDRMh (ORCPT ); Mon, 4 May 2020 13:12:37 -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 288B9AC53; Mon, 4 May 2020 17:12:37 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 30/34] staging: vchiq_arm: Give vchiq children DT nodes From: Nicolas Saenz Julienne To: Laurent Pinchart , linux-media@vger.kernel.org Cc: Kieran Bingham , Jacopo Mondi , Niklas =?ISO-8859-1?Q?S=F6derlund?= , Naushir Patuck , Dave Stevenson , Phil Elwell Date: Mon, 04 May 2020 19:12:33 +0200 In-Reply-To: <20200504092611.9798-31-laurent.pinchart@ideasonboard.com> References: <20200504092611.9798-1-laurent.pinchart@ideasonboard.com> <20200504092611.9798-31-laurent.pinchart@ideasonboard.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-xiv4Wya8vifKkT85HxxB" User-Agent: Evolution 3.36.2 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org --=-xiv4Wya8vifKkT85HxxB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Phil, Laurent, On Mon, 2020-05-04 at 12:26 +0300, Laurent Pinchart wrote: > From: Phil Elwell >=20 > vchiq kernel clients are now instantiated as platform drivers rather > than using DT, but the children of the vchiq interface may still > benefit from access to DT properties. Give them the option of a > a sub-node of the vchiq parent for configuration and to allow > them to be disabled. >=20 > Signed-off-by: Phil Elwell > Signed-off-by: Jacopo Mondi > --- > .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.= c > b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > index dd3c8f829daa..2325ab825941 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > @@ -2734,12 +2734,20 @@ vchiq_register_child(struct platform_device *pdev= , > const char *name) > pdevinfo.id =3D PLATFORM_DEVID_NONE; > pdevinfo.dma_mask =3D DMA_BIT_MASK(32); > =20 > + np =3D of_get_child_by_name(pdev->dev.of_node, name); > + > + /* Skip the child if it is explicitly disabled */ > + if (np && !of_device_is_available(np)) > + return NULL; I think this is alright, although I'd reshufle the code a little so it look= s nicer: + /* Skip the child if it is explicitly disabled */ + np =3D of_get_child_by_name(pdev->dev.of_node, name); + if (np && !of_device_is_available(np)) + return NULL; > child =3D platform_device_register_full(&pdevinfo); > if (IS_ERR(child)) { > dev_warn(&pdev->dev, "%s not registered\n", name); > child =3D NULL; > } > =20 > + child->dev.of_node =3D np; Is this really needed? I'd rather have the parent's np (as commented in pat= ch 26) as long as this is not a real device-tree defined platform device. Regards, Nicolas --=-xiv4Wya8vifKkT85HxxB 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/4FAl6wTQEACgkQlfZmHno8 x/7OLQf/Z+X4fq+pEsJXaMHeAH5A9cGBLakZTRBEQrRlds77ejBxDIng6OpnzkaY 1b0kvSNm0Ad+txrpelCUF1PqacLuL3ZZobZ4+Ds2Lg5Kggpa0HuIZaJkVCzRUjFd zwM1lmT2ZgwLYAuou/FQGh2XxQmvCDbF81CydGJSBLUBh4MMQBe/+oGrNgCycL8P E+ewfOnZtzOe/hzEm9ezGrugCyh9PCi0vLCKKLebcvKzYoNCwr5xev2uwNL+Dzch 2BLPyN/2B7QEfP7I0/DAmSn0p4OhhqTI7lrT/yFMiYMFafZHuF8Iix0tEkj+QeoP 4kA8mZPXUqvaGTV91VpFbJj7khypKw== =9LZz -----END PGP SIGNATURE----- --=-xiv4Wya8vifKkT85HxxB--