[PATCH] PCI: Use of_node_name_eq for node name comparisons

Bjorn Helgaas helgaas at kernel.org
Sat Apr 25 09:03:40 AEST 2020


On Thu, Apr 16, 2020 at 04:51:14PM -0500, Rob Herring wrote:
> Convert string compares of DT node names to use of_node_name_eq helper
> instead. This removes direct access to the node name pointer.
> 
> Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Cc: Paul Mackerras <paulus at samba.org>
> Cc: Michael Ellerman <mpe at ellerman.id.au>
> Cc: Bjorn Helgaas <bhelgaas at google.com>
> Cc: linuxppc-dev at lists.ozlabs.org
> Cc: linux-pci at vger.kernel.org
> Signed-off-by: Rob Herring <robh at kernel.org>

Applied to pci/hotplug for v5.8, thanks!

> ---
>  drivers/pci/hotplug/rpaphp_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
> index 6504869efabc..9887c9de08c3 100644
> --- a/drivers/pci/hotplug/rpaphp_core.c
> +++ b/drivers/pci/hotplug/rpaphp_core.c
> @@ -435,7 +435,7 @@ static int rpaphp_drc_add_slot(struct device_node *dn)
>   */
>  int rpaphp_add_slot(struct device_node *dn)
>  {
> -	if (!dn->name || strcmp(dn->name, "pci"))
> +	if (!of_node_name_eq(dn, "pci"))
>  		return 0;
>  
>  	if (of_find_property(dn, "ibm,drc-info", NULL))
> -- 
> 2.20.1
> 


More information about the Linuxppc-dev mailing list