All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pawel Laszczak <pawell@cadence.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"balbi@kernel.org" <balbi@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"ben.dooks@codethink.co.uk" <ben.dooks@codethink.co.uk>,
	"colin.king@canonical.com" <colin.king@canonical.com>,
	"rogerq@ti.com" <rogerq@ti.com>,
	"peter.chen@nxp.com" <peter.chen@nxp.com>,
	"weiyongjun1@huawei.com" <weiyongjun1@huawei.com>,
	Jayshri Dajiram Pawar <jpawar@cadence.com>,
	Rahul Kumar <kurahul@cadence.com>,
	Sanket Parmar <sparmar@cadence.com>
Subject: RE: [PATCH RFC 2/5] usb:cdns3: Add pci to platform driver wrapper
Date: Mon, 29 Jun 2020 06:51:20 +0000	[thread overview]
Message-ID: <DM6PR07MB55290187EE04FAB06CA69816DD6E0@DM6PR07MB5529.namprd07.prod.outlook.com> (raw)
In-Reply-To: <20200626172411.GE2571@kadam>


>
>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().

Right, I will add this,

>
>regards,
>dan carpenter

regards,
pawel

  reply	other threads:[~2020-06-29 18:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  4:54 [PATCH RFC 0/5] Introduced new Cadence USBSSP DRD Driver Pawel Laszczak
2020-06-26  4:54 ` [PATCH RFC 1/5] dt-bindings: add binding for CDNSP-DRD controller Pawel Laszczak
2020-06-29 22:03   ` Rob Herring
2020-06-30  8:19     ` Pawel Laszczak
2020-06-26  4:54 ` [PATCH RFC 2/5] usb:cdns3: Add pci to platform driver wrapper Pawel Laszczak
2020-06-26 11:40   ` Dan Carpenter
2020-06-26 15:10     ` Pawel Laszczak
2020-06-26 17:24       ` Dan Carpenter
2020-06-29  6:51         ` Pawel Laszczak [this message]
2020-06-26 13:43   ` Greg KH
2020-06-29 11:35     ` Pawel Laszczak
2020-06-29 11:43       ` Greg KH
2020-06-26  4:54 ` [PATCH RFC 3/5] usb: cdnsp: Device side header file for CDNSP driver Pawel Laszczak
2020-06-26  4:54 ` [PATCH RFC 4/5] usb: cdnsp: usb:cdns3 Add main part of Cadence USBSSP DRD Driver Pawel Laszczak
2020-06-26  9:04   ` kernel test robot
2020-06-29 10:16   ` Dan Carpenter
2020-07-02  3:48     ` Pawel Laszczak
2020-06-26  4:54 ` [PATCH RFC 5/5] usb: cdnsp: Add tracepoints for CDNSP driver Pawel Laszczak
2020-06-26  6:52 ` [PATCH RFC 0/5] Introduced new Cadence USBSSP DRD Driver Felipe Balbi
2020-06-26  7:19   ` Pawel Laszczak
2020-06-29  3:41     ` Peter Chen
2020-06-29  4:31       ` gregkh
2020-06-29 11:20         ` Pawel Laszczak
2020-06-29 11:43           ` gregkh
2020-09-22 13:06         ` Pawel Laszczak
2020-09-23  2:56           ` Peter Chen
2020-09-23  3:37             ` Pawel Laszczak

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=DM6PR07MB55290187EE04FAB06CA69816DD6E0@DM6PR07MB5529.namprd07.prod.outlook.com \
    --to=pawell@cadence.com \
    --cc=balbi@kernel.org \
    --cc=ben.dooks@codethink.co.uk \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jpawar@cadence.com \
    --cc=kurahul@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=rogerq@ti.com \
    --cc=sparmar@cadence.com \
    --cc=weiyongjun1@huawei.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.