Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10679857rwl; Mon, 2 Jan 2023 06:35:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXueayUnCwmBMF4rCZse2Ipc1JWp+hyPj4oVgU6wrlqSZnBd3z2/XjEclSCmGIKbVolWkR18 X-Received: by 2002:a05:6402:1458:b0:47d:a733:c051 with SMTP id d24-20020a056402145800b0047da733c051mr38050755edx.15.1672670100691; Mon, 02 Jan 2023 06:35:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672670100; cv=none; d=google.com; s=arc-20160816; b=ZsBuBP8B8UKXsRtNoIi08U3zwgDeZ3HK6AFOfH7BxoKVKRrO6cZi6oxLCT32A2O2vH TCUg6jPYFG+E5uCHwptdHBxxZzhaFuOsUkoEfaK2jwVXRr5KtxqEPuS3DJ4j67QWsUu6 3rN9a4ZPedJS128iLGJoXXNrjHh1Q7obpyMNZCUXKwQBbtgA3I5xqmGnsEEoGQwX9tJC SBnIrnEHikXo2t0rbZXwzLY0nroxZgy4pwHd9fpiHnrhhvpkMutepzT1BUHh5XImrACZ sCUuqPfk9NqFlxWd5RRh6sGF5/ouG/CrXQ4WEQyHf2QBihJAD5Or216DJAvnzU8lKmAU mmJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=XI1jqSD80O19fS9j+6GijbwVoDQ0YZyBahVLr8QSp4A=; b=yDJBm47HVrURTHU9KEpYwo/E7hmm6UemwBFdTRN9kWGtVVNymnBENdBcg9XCcUHNZH LOw9s5TW6djx+1BlhJq9LtS3rfI/+epA4cIOwg61vf04Qgj6+rgys3pU9ivaFCpR91VJ eP7Kscf8GOLZydEC8DsT18JiEg4jjzX4ihckh2iUkuOn5G/JNehaRdzScPZU7bAklMVd RXzM9We76OKEUCQ0OUoPQ9PIJsUaFoui7hyl2BGzcBCPobARSCGSw7IP0gchJDvNpf75 z9xIAPr5Zr7fPDDOFxuYQmA1Dk5FHGGKiUn5VkxXGeQTD/b2ccBR/3Gq3yVhyAfXiYrh Bx2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="XEP/DVAK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s29-20020a50ab1d000000b0046b3638938bsi24229417edc.536.2023.01.02.06.34.45; Mon, 02 Jan 2023 06:35:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="XEP/DVAK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236017AbjABNyS (ORCPT + 62 others); Mon, 2 Jan 2023 08:54:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjABNyQ (ORCPT ); Mon, 2 Jan 2023 08:54:16 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 093C027C; Mon, 2 Jan 2023 05:54:14 -0800 (PST) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 56B8F20005; Mon, 2 Jan 2023 13:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1672667650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XI1jqSD80O19fS9j+6GijbwVoDQ0YZyBahVLr8QSp4A=; b=XEP/DVAKSf5CmbUL+ECBUNjhk6W6ixRGlmWUIjLJKIAxMHXit+mqGsUUXNbpXf9ZxZVpXq L0iDJ6F+F2yux1N3ok7LHtnVlztq/NTQ7KJk0O9xLmVgJBazVdLkc/9TCXs03q0e7z2PlP C7Cghn6C+bndokE/9VH0fCchUTMXfOG/5oc/65P2+DdrTrRgvBDdUQr6P697SLlCHFxmzg 43PV9iSgyBEtsZrbn3sMi0KvTJBO0cRGqOD0SkpmA8EElxMkzilXrgFZo8O5aIfp14/HFw Tx9WyvJ3vECiEwLwNL2UwTgVV/YM6OG/qXCCocbazR5TPmXig3/CvAq+SNXTcw== Date: Mon, 2 Jan 2023 14:56:18 +0100 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Lizhi Hou Cc: , , , , , , , , , , , , "Allan.Nielsen@microchip.com" , "Horatiu.Vultur@microchip.com" , "Steen.Hegelund@microchip.com" Subject: Re: [PATCH V5 2/3] PCI: Create device tree node for selected devices Message-ID: <20230102145618.4b5bace8@fixe.home> In-Reply-To: <1671125446-57584-3-git-send-email-lizhi.hou@amd.com> References: <1671125446-57584-1-git-send-email-lizhi.hou@amd.com> <1671125446-57584-3-git-send-email-lizhi.hou@amd.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Thu, 15 Dec 2022 09:30:45 -0800, Lizhi Hou a =C3=A9crit : > +}; > + > +static int of_pci_prop_device_type(struct pci_dev *pdev, > + struct of_changeset *ocs, > + struct device_node *np) > +{ > + return of_changeset_add_prop_string(ocs, np, "device_type", "pci"); > +} > + > +static int of_pci_prop_address_cells(struct pci_dev *pdev, > + struct of_changeset *ocs, > + struct device_node *np) > +{ > + return of_changeset_add_prop_u32(ocs, np, "#address_cells", > + OF_PCI_ADDRESS_CELLS); > +} > + > +static int of_pci_prop_size_cells(struct pci_dev *pdev, > + struct of_changeset *ocs, > + struct device_node *np) > +{ > + return of_changeset_add_prop_u32(ocs, np, "#size_cells", > + OF_PCI_SIZE_CELLS); > +} Hi Lizhi, For all these functions, the "pdev" parameter is actually unused. [snip] > + > +static int of_pci_prop_compatible(struct pci_dev *pdev, > + struct of_changeset *ocs, > + struct device_node *np) > +{ > + const char *compat_strs[PROP_COMPAT_NUM] =3D { 0 }; > + int i, ret; > + > + compat_strs[PROP_COMPAT_PCI_VVVV_DDDD] =3D > + kasprintf(GFP_KERNEL, "pci%x,%x", pdev->vendor, pdev->device); Maybe it should be better to use "pci%04x,%04x" to keep the existing naming. --=20 Cl=C3=A9ment L=C3=A9ger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com