All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Clément Léger" <clement.leger@bootlin.com>
To: Lizhi Hou <lizhi.hou@amd.com>
Cc: <linux-pci@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <robh@kernel.org>,
	<frowand.list@gmail.com>, <helgaas@kernel.org>,
	<max.zhen@amd.com>, <sonal.santan@amd.com>, <larry.liu@amd.com>,
	<brian.xu@amd.com>, <stefano.stabellini@xilinx.com>,
	<trix@redhat.com>,
	"Allan.Nielsen@microchip.com" <Allan.Nielsen@microchip.com>,
	"Horatiu.Vultur@microchip.com" <Horatiu.Vultur@microchip.com>,
	"Steen.Hegelund@microchip.com" <Steen.Hegelund@microchip.com>
Subject: Re: [PATCH V5 2/3] PCI: Create device tree node for selected devices
Date: Mon, 2 Jan 2023 14:56:18 +0100	[thread overview]
Message-ID: <20230102145618.4b5bace8@fixe.home> (raw)
In-Reply-To: <1671125446-57584-3-git-send-email-lizhi.hou@amd.com>

Le Thu, 15 Dec 2022 09:30:45 -0800,
Lizhi Hou <lizhi.hou@amd.com> a écrit :

> +};
> +
> +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] = { 0 };
> +	int i, ret;
> +
> +	compat_strs[PROP_COMPAT_PCI_VVVV_DDDD] =
> +		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.

-- 
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com

  reply	other threads:[~2023-01-02 13:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 17:30 [PATCH V5 0/3] Generate device tree node for pci devices Lizhi Hou
2022-12-15 17:30 ` [PATCH V5 1/3] of: dynamic: Add interfaces for creating device node dynamically Lizhi Hou
2023-01-02 13:50   ` Clément Léger
2023-01-03 18:34     ` Lizhi Hou
2022-12-15 17:30 ` [PATCH V5 2/3] PCI: Create device tree node for selected devices Lizhi Hou
2023-01-02 13:56   ` Clément Léger [this message]
2023-01-03 18:44     ` Lizhi Hou
2023-01-03 19:34       ` clement.leger
2023-01-02 17:16   ` Clément Léger
2023-01-03 19:45     ` Lizhi Hou
2023-01-04  0:29       ` Lizhi Hou
2023-01-03 14:48   ` Clément Léger
2023-01-04  0:31     ` Lizhi Hou
2023-01-04  5:57       ` clement.leger
2023-01-03 15:38   ` Clément Léger
2022-12-15 17:30 ` [PATCH V5 3/3] PCI: Add PCI quirks to generate device tree node for Xilinx Alveo U50 Lizhi Hou
  -- strict thread matches above, loose matches on Subject: below --
2022-12-09 19:38 [PATCH V5 0/3] Generate device tree node for pci devices Lizhi Hou
2022-12-09 19:38 ` [PATCH V5 2/3] PCI: Create device tree node for selected devices Lizhi Hou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230102145618.4b5bace8@fixe.home \
    --to=clement.leger@bootlin.com \
    --cc=Allan.Nielsen@microchip.com \
    --cc=Horatiu.Vultur@microchip.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=brian.xu@amd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=larry.liu@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=max.zhen@amd.com \
    --cc=robh@kernel.org \
    --cc=sonal.santan@amd.com \
    --cc=stefano.stabellini@xilinx.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.