linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@linux.intel.com>
To: "Steven J. Hill" <steven.hill@cavium.com>, linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
	David Daney <david.daney@cavium.com>
Subject: Re: [PATCH] usb: dwc3: OCTEON: add support for device tree
Date: Thu, 08 Sep 2016 10:54:54 +0300	[thread overview]
Message-ID: <8760q6ker5.fsf@linux.intel.com> (raw)
In-Reply-To: <eb11c5c9-62c8-ee1b-0030-c8885015e6c3@cavium.com>

[-- Attachment #1: Type: text/plain, Size: 2047 bytes --]


Hi Steven,

"Steven J. Hill" <steven.hill@cavium.com> writes:
> This patch adds support to parse probe data for
> the dwc3-octeon driver using device tree. The
> DWC3 IP core is found on OCTEON III processors.
>
> Signed-off-by: Steven J. Hill <Steven.Hill@cavium.com>
> ---
>  drivers/usb/dwc3/Kconfig       | 10 +++++
>  drivers/usb/dwc3/Makefile      |  1 +
>  drivers/usb/dwc3/dwc3-octeon.c | 96 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 107 insertions(+)
>  create mode 100644 drivers/usb/dwc3/dwc3-octeon.c
>
> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> index a64ce1c..99db6008 100644
> --- a/drivers/usb/dwc3/Kconfig
> +++ b/drivers/usb/dwc3/Kconfig
> @@ -105,4 +105,14 @@ config USB_DWC3_ST
>  	  inside (i.e. STiH407).
>  	  Say 'Y' or 'M' if you have one such device.
>  
> +config USB_DWC3_OCTEON
> +	tristate "Cavium OCTEON III Platforms"
> +	depends on CAVIUM_OCTEON_SOC

we really don't want SoC dependencies. At a minimum, you should have:

	depends on CAVIUM_OCTEON_SOC || COMPILE_TEST

> +static int dwc3_octeon_probe(struct platform_device *pdev)
> +{
> +	struct device		*dev = &pdev->dev;
> +	struct resource		*res;
> +	struct dwc3_octeon	*octeon;
> +	int			ret;
> +
> +	octeon = devm_kzalloc(dev, sizeof(*octeon), GFP_KERNEL);
> +	if (!octeon)
> +		return - ENOMEM;
> +
> +	/*
> +	 * Right now device-tree probed devices don't get dma_mask set.
> +	 * Since shared usb code relies on it, set it here for now.
> +	 */

this doesn't look correct to me. Are you, perhaps, just missing
dma-ranges and dma-coherent properties?

> +static int dwc3_octeon_remove(struct platform_device *pdev)
> +{
> +	struct dwc3_octeon *octeon = platform_get_drvdata(pdev);
> +
> +	octeon->usbctl = NULL;
> +	octeon->index = -1;

octeon is going to be freed when ->remove() gets executed. You really
don't need to do these. In fact, setting usbctl to NULL will break
iounmap(). It seems to be me you don't need a remove at all.

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

      reply	other threads:[~2016-09-08  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  3:11 [PATCH] usb: dwc3: OCTEON: add support for device tree Steven J. Hill
2016-09-08  7:54 ` Felipe Balbi [this message]

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=8760q6ker5.fsf@linux.intel.com \
    --to=felipe.balbi@linux.intel.com \
    --cc=david.daney@cavium.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=steven.hill@cavium.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 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).