linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 0/7] PCI: Prefer of_device_get_match_data() over of_match_device()
       [not found] <cover.1637678103.git.ffclaire1224@gmail.com>
@ 2021-12-08 20:50 ` Bjorn Helgaas
  2021-12-08 21:21   ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2021-12-08 20:50 UTC (permalink / raw)
  To: Fan Fei; +Cc: linux-pci, linux-kernel-mentees

On Tue, Nov 23, 2021 at 04:37:55PM +0100, Fan Fei wrote:
> Some drivers use of_match_device() in probe(), which returns a 
> "struct of_device_id *". They need only the of_device_id.data member, so 
> replace of_device_get_match_data() with of_match_device().
> 
> Fan Fei (7):
>   PCI: altera: Prefer of_device_get_match_data() over of_match_device()
>   PCI: cadence: Prefer of_device_get_match_data() over of_match_device()
>   PCI: kirin: Prefer of_device_get_match_data() over of_match_device()
>   PCI: dra7xx: Prefer of_device_get_match_data() over of_match_device()
>   PCI: keystone: Prefer of_device_get_match_data() over
>     of_match_device()
>   PCI: artpec6: Prefer of_device_get_match_data() over of_match_device()
>   PCI: dwc: Prefer of_device_get_match_data() over of_device_device()
> 
>  drivers/pci/controller/cadence/pcie-cadence-plat.c | 6 ++----
>  drivers/pci/controller/dwc/pci-dra7xx.c            | 6 ++----
>  drivers/pci/controller/dwc/pci-keystone.c          | 4 +---
>  drivers/pci/controller/dwc/pcie-artpec6.c          | 6 ++----
>  drivers/pci/controller/dwc/pcie-designware-plat.c  | 6 ++----
>  drivers/pci/controller/dwc/pcie-kirin.c            | 6 ++----
>  drivers/pci/controller/pcie-altera.c               | 8 ++++----
>  7 files changed, 15 insertions(+), 27 deletions(-)

Applied to pci/driver-cleanup for v5.17, thank you, Fan!
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 0/7] PCI: Prefer of_device_get_match_data() over of_match_device()
  2021-12-08 20:50 ` [PATCH 0/7] PCI: Prefer of_device_get_match_data() over of_match_device() Bjorn Helgaas
@ 2021-12-08 21:21   ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2021-12-08 21:21 UTC (permalink / raw)
  To: Fan Fei; +Cc: linux-pci, linux-kernel-mentees

On Wed, Dec 08, 2021 at 02:50:47PM -0600, Bjorn Helgaas wrote:
> On Tue, Nov 23, 2021 at 04:37:55PM +0100, Fan Fei wrote:
> > Some drivers use of_match_device() in probe(), which returns a 
> > "struct of_device_id *". They need only the of_device_id.data member, so 
> > replace of_device_get_match_data() with of_match_device().
> > 
> > Fan Fei (7):
> >   PCI: altera: Prefer of_device_get_match_data() over of_match_device()
> >   PCI: cadence: Prefer of_device_get_match_data() over of_match_device()
> >   PCI: kirin: Prefer of_device_get_match_data() over of_match_device()
> >   PCI: dra7xx: Prefer of_device_get_match_data() over of_match_device()
> >   PCI: keystone: Prefer of_device_get_match_data() over
> >     of_match_device()
> >   PCI: artpec6: Prefer of_device_get_match_data() over of_match_device()
> >   PCI: dwc: Prefer of_device_get_match_data() over of_device_device()
> > 
> >  drivers/pci/controller/cadence/pcie-cadence-plat.c | 6 ++----
> >  drivers/pci/controller/dwc/pci-dra7xx.c            | 6 ++----
> >  drivers/pci/controller/dwc/pci-keystone.c          | 4 +---
> >  drivers/pci/controller/dwc/pcie-artpec6.c          | 6 ++----
> >  drivers/pci/controller/dwc/pcie-designware-plat.c  | 6 ++----
> >  drivers/pci/controller/dwc/pcie-kirin.c            | 6 ++----
> >  drivers/pci/controller/pcie-altera.c               | 8 ++++----
> >  7 files changed, 15 insertions(+), 27 deletions(-)
> 
> Applied to pci/driver-cleanup for v5.17, thank you, Fan!

Also applied the following patch since it's closely related.


commit 667c60afad25 ("PCI: j721e: Drop pointless of_device_get_match_data() cast")
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Wed Dec 8 15:18:20 2021 -0600

    PCI: j721e: Drop pointless of_device_get_match_data() cast
    
    of_device_get_match_data() returns "void *", so no cast is needed when
    assigning the result to a pointer type.  Drop the unnecessary cast.
    
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
index 918e11082e6a..0aa1c184bd42 100644
--- a/drivers/pci/controller/cadence/pci-j721e.c
+++ b/drivers/pci/controller/cadence/pci-j721e.c
@@ -367,7 +367,7 @@ static int j721e_pcie_probe(struct platform_device *pdev)
 	int ret;
 	int irq;
 
-	data = (struct j721e_pcie_data *)of_device_get_match_data(dev);
+	data = of_device_get_match_data(dev);
 	if (!data)
 		return -EINVAL;
 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-08 21:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1637678103.git.ffclaire1224@gmail.com>
2021-12-08 20:50 ` [PATCH 0/7] PCI: Prefer of_device_get_match_data() over of_match_device() Bjorn Helgaas
2021-12-08 21:21   ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).