lkml.org 
[lkml]   [2020]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 2/5] usb:cdns3: Add pci to platform driver wrapper
On Fri, Jun 26, 2020 at 03:10:32PM +0000, Pawel Laszczak wrote:
> >> +static int cdnsp_pci_probe(struct pci_dev *pdev,
> >> + const struct pci_device_id *id)
> >> +{
> >> + struct platform_device_info plat_info;
> >> + struct cdnsp_wrap *wrap;
> >> + struct resource *res;
> >> + struct pci_dev *func;
> >> + int err;
> >> +
> >> + /*
> >> + * For GADGET/HOST PCI (devfn) function number is 0,
> >> + * for OTG PCI (devfn) function number is 1.
> >> + */
> >> + if (!id || (pdev->devfn != PCI_DEV_FN_HOST_DEVICE &&
> >> + pdev->devfn != PCI_DEV_FN_OTG))
> >> + return -EINVAL;
> >> +
> >> + func = cdnsp_get_second_fun(pdev);
> >> + if (unlikely(!func))
> >> + return -EINVAL;
> >> +
> >> + if (func->class == PCI_CLASS_SERIAL_USB_XHCI ||
> >> + pdev->class == PCI_CLASS_SERIAL_USB_XHCI)
> >> + return -EINVAL;
> >
> >
> >Do we need call pci_put_device(func) before returning?
>
> We don't need.
> Such function doesn't exist.
>

I meant pci_dev_put(). I'm pretty sure that we do need it to match the
pci_get_device() in cdnsp_get_second_fun().

regards,
dan carpenter

\
 
 \ /
  Last update: 2020-06-26 19:25    [W:0.645 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site