Received: by 10.223.185.116 with SMTP id b49csp791814wrg; Fri, 23 Feb 2018 06:55:54 -0800 (PST) X-Google-Smtp-Source: AH8x226lxlFjY46x+v+6p8FFpbWgGqSqOfVAWtl2UdtEPBkD8QA7FPEt6uzRIGuhWOP27YO4wE4S X-Received: by 10.98.147.156 with SMTP id r28mr2072959pfk.204.1519397754772; Fri, 23 Feb 2018 06:55:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519397754; cv=none; d=google.com; s=arc-20160816; b=08ruxhuuY5jDTeFL9uIHfvfrUPN5uJqcGaaTuduR+jHfPk/o252QSsi3oh0DHckasi fk7yX13VNPBL5BmqhzRQLrH+EtaYvX2bXfPaoleYWAM4U7PRbbwdCFVde25Ek2rfzhU/ M+Yh22BFC5EnmUsjLKzvc7g082SBsTfMcweAEX/F+M95HQuidlkA+Qwwa9tbTi5cdFfR p+H2zAt62z7HOCTJb7fvH4QHyZlC0ELmRh3PgozrgNDsfJfIQLpcFNeZt9hKh+gZm/ld r956iMogkjrLg5CQIVmpLpQKT6XDtgkQ/rFafeMW8k6dXdP8VhWNaOThaczNk0Bu6OVP +OgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=/Suib1Jj+PENUxHLPo3IO94QvpxjoQH4TuwhrXusAPQ=; b=siGDbHVDAy3QykM3mHrkRS/BBZQIZYRMuRnl9Ng9ky4dwVqEIrSu5uM/rpC76nQrWH FeuNEj9hepa530QIOfGSsVsEKYrlvOSDU5DQv07L8TPc/ZDRVHrdl5cj7Y7OUM0IcqAb HCza0XR4SuPCQ4DY7a0bOy6S1X8QJd3rtJ6Vxk+wnMquaeoibkGF+cdDyJ1Rm3W6MWfa aVRk81xtwOPzMVzR0qnQLx4epzBwu4iQ1FA3t8P8grT5gX10gnbgua78ni/0NQZAEaWN gwXqt4DIjjIZ/LDavevSrk+Ra9e8ezetGhLdPL6GaMVf0ojb6NZEEcs1sRk1p6m3rcHT s72Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y26si1934102pfm.63.2018.02.23.06.55.38; Fri, 23 Feb 2018 06:55:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751563AbeBWOy1 (ORCPT + 99 others); Fri, 23 Feb 2018 09:54:27 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:52193 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbeBWOy0 (ORCPT ); Fri, 23 Feb 2018 09:54:26 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 1E26C2082B; Fri, 23 Feb 2018 15:54:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [185.94.189.188]) by mail.free-electrons.com (Postfix) with ESMTPSA id B5CAA20146; Fri, 23 Feb 2018 15:54:22 +0100 (CET) Date: Fri, 23 Feb 2018 15:54:23 +0100 From: Maxime Ripard To: =?iso-8859-1?Q?Myl=E8ne?= Josserand Cc: linux@armlinux.org.uk, wens@csie.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clabbe.montjoie@gmail.com, thomas.petazzoni@bootlin.com, quentin.schulz@bootlin.com Subject: Re: [PATCH v4 01/10] ARM: sun9i: smp: Add sun9i dt parsing function Message-ID: <20180223145423.5og5bdhtznu5qlw7@flea.lan> References: <20180223133742.26044-1-mylene.josserand@bootlin.com> <20180223133742.26044-2-mylene.josserand@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="57ofgl56jgiq36ka" Content-Disposition: inline In-Reply-To: <20180223133742.26044-2-mylene.josserand@bootlin.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --57ofgl56jgiq36ka Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Feb 23, 2018 at 02:37:33PM +0100, Myl=E8ne Josserand wrote: > To prepare the support for sun8i-a83t, create a new function > that handles all the resources needed on sun9i-a80 (because > it will be different from sun8i-a83t). >=20 > All the parsing of device tree is moved into this new function: > sun9i_dt_parsing. Create also a function to release the resources > retrieved during the dt parsing in case there is an error in init > function. >=20 > Signed-off-by: Myl=E8ne Josserand > --- > arch/arm/mach-sunxi/mc_smp.c | 99 ++++++++++++++++++++++++++------------= ------ > 1 file changed, 58 insertions(+), 41 deletions(-) >=20 > diff --git a/arch/arm/mach-sunxi/mc_smp.c b/arch/arm/mach-sunxi/mc_smp.c > index 11e46c6efb90..650a2ad4398f 100644 > --- a/arch/arm/mach-sunxi/mc_smp.c > +++ b/arch/arm/mach-sunxi/mc_smp.c > @@ -684,35 +684,22 @@ static int __init sunxi_mc_smp_lookback(void) > return ret; > } > =20 > -static int __init sunxi_mc_smp_init(void) > +static int sun9i_dt_parsing(struct resource res) Like I told you in the previous version, this should be _parse_dt, and not _dt_parsing. Also, I'm not sure why you are passing by copy the resource structure? > { > - struct device_node *cpucfg_node, *sram_node, *node; > - struct resource res; > + struct device_node *prcm_node, *cpucfg_node, *sram_node; > int ret; > =20 > - if (!of_machine_is_compatible("allwinner,sun9i-a80")) > - return -ENODEV; > - > - if (!sunxi_mc_smp_cpu_table_init()) > - return -EINVAL; > - > - if (!cci_probed()) { > - pr_err("%s: CCI-400 not available\n", __func__); > - return -ENODEV; > - } > - > - node =3D of_find_compatible_node(NULL, NULL, "allwinner,sun9i-a80-prcm"= ); > - if (!node) { > - pr_err("%s: PRCM not available\n", __func__); > + prcm_node =3D of_find_compatible_node(NULL, NULL, > + "allwinner,sun9i-a80-prcm"); > + if (!prcm_node) > return -ENODEV; > - } > =20 > /* > * Unfortunately we can not request the I/O region for the PRCM. > * It is shared with the PRCM clock. > */ > - prcm_base =3D of_iomap(node, 0); > - of_node_put(node); > + prcm_base =3D of_iomap(prcm_node, 0); So it does more a bit more than just parsing the DT? Can you maybe just fill the DT nodes and have the common part map the memory regions if the pointer is not NULL? Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --57ofgl56jgiq36ka Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlqQKx4ACgkQ0rTAlCFN r3Q01w//WaHbgn54ArvGB7FNCVQh84gMjz+7RnszcF89tlJg9aQNnGsBlzZLbaun uKpf/K4n3TI8cgL568wCPrdu00yiqftX56IvQvh2qtgDVSBRv+b30ftjqy3OMJ9E UBiTh1KDdZtdpzrcxCm1eUtBSkxtajTgYsX55kRK/EsQ08z8jTVPx4P7UbyTCaUC 0ufBeUh1gz2KKHs0NCF7pVHaXCvahK5K3JCvfGnlar7sbAxHsc8SLvGGWG+DDWuK K3iOmFWQM6GUc4js63HAoDKSnH5NXTf7OiPj2BEscdNT2zWpDFPRItoAwLzmgQGo McLDkW92tcoSp7ipB7tpTv/RZOJ9FTpdok8K5Rq5Fmo5WHqjT9N+dDDeOUH3idt4 loDTBTVBcwlq9DuJTC2B+99DRmjRcSOsFVktXMv4CZUBeIgBffEe0LnRuvj3OoBn gzBlqHrT1XC9xrSDljehqlibGvd7+FZEoeQ+hlRJnmYn6MVuTW9N8qb937b07MBP j9Ee14Pte+51hTrdvgvSKAExD3y6gE75tZHWf34ir7gdBvv095uvlYJRsJsMAoDK XDD0CYjCxjjptoaxv48WX+VSuDstBMsR1gWlEDIVluQDv/1sRco4U66lBBN+3gZ6 Nf9MyFChxlzM2RDPwWtdnZmlpJQWQZy3c7MykNK9xftdM1Px+ig= =+F+R -----END PGP SIGNATURE----- --57ofgl56jgiq36ka--