All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Andy Gross <agross@codeaurora.org>
Cc: Felipe Balbi <balbi@ti.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Ivan T. Ivanov" <iivanov@mm-sol.com>,
	linux-arm-kernel@lists.infradead.org,
	Kumar Gala <galak@codeaurora.org>,
	jackp@codeaurora.org, linux-arm-msm@vger.kernel.org
Subject: Re: [Patch v7 1/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver
Date: Mon, 30 Jun 2014 11:52:52 -0500	[thread overview]
Message-ID: <20140630165252.GC31442@saruman.home> (raw)
In-Reply-To: <1404144233-17222-2-git-send-email-agross@codeaurora.org>

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

Hi,

On Mon, Jun 30, 2014 at 11:03:51AM -0500, Andy Gross wrote:
> +static int dwc3_qcom_probe(struct platform_device *pdev)
> +{
> +	struct device_node *node = pdev->dev.of_node;
> +	struct dwc3_qcom *qdwc;
> +	int ret = 0;
> +
> +	qdwc = devm_kzalloc(&pdev->dev, sizeof(*qdwc), GFP_KERNEL);
> +	if (!qdwc)
> +		return -ENOMEM;
> +
> +	platform_set_drvdata(pdev, qdwc);
> +
> +	qdwc->dev = &pdev->dev;
> +
> +	qdwc->gdsc = devm_regulator_get(qdwc->dev, "gdsc");
> +
> +	qdwc->core_clk = devm_clk_get(qdwc->dev, "core");
> +	if (IS_ERR(qdwc->core_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get core clock\n");
> +		return PTR_ERR(qdwc->core_clk);
> +	}
> +
> +	qdwc->iface_clk = devm_clk_get(qdwc->dev, "iface");
> +	if (IS_ERR(qdwc->iface_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get iface clock, skipping\n");
> +		qdwc->iface_clk = NULL;

so this clock and sleep_clk are optional, that's fine...

> +	}
> +
> +	qdwc->sleep_clk = devm_clk_get(qdwc->dev, "sleep");
> +	if (IS_ERR(qdwc->sleep_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get sleep clock, skipping\n");
> +		qdwc->sleep_clk = NULL;
> +	}
> +
> +	if (!IS_ERR(qdwc->gdsc)) {
> +		ret = regulator_enable(qdwc->gdsc);
> +		if (ret)
> +			dev_err(qdwc->dev, "cannot enable gdsc\n");
> +	}
> +
> +	clk_prepare_enable(qdwc->core_clk);
> +
> +	if (qdwc->iface_clk)
> +		clk_prepare_enable(qdwc->iface_clk);

... right here you can drop the NULL check because clk_prepare_enable()
is safe against NULL pointers.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [Patch v7 1/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver
Date: Mon, 30 Jun 2014 11:52:52 -0500	[thread overview]
Message-ID: <20140630165252.GC31442@saruman.home> (raw)
In-Reply-To: <1404144233-17222-2-git-send-email-agross@codeaurora.org>

Hi,

On Mon, Jun 30, 2014 at 11:03:51AM -0500, Andy Gross wrote:
> +static int dwc3_qcom_probe(struct platform_device *pdev)
> +{
> +	struct device_node *node = pdev->dev.of_node;
> +	struct dwc3_qcom *qdwc;
> +	int ret = 0;
> +
> +	qdwc = devm_kzalloc(&pdev->dev, sizeof(*qdwc), GFP_KERNEL);
> +	if (!qdwc)
> +		return -ENOMEM;
> +
> +	platform_set_drvdata(pdev, qdwc);
> +
> +	qdwc->dev = &pdev->dev;
> +
> +	qdwc->gdsc = devm_regulator_get(qdwc->dev, "gdsc");
> +
> +	qdwc->core_clk = devm_clk_get(qdwc->dev, "core");
> +	if (IS_ERR(qdwc->core_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get core clock\n");
> +		return PTR_ERR(qdwc->core_clk);
> +	}
> +
> +	qdwc->iface_clk = devm_clk_get(qdwc->dev, "iface");
> +	if (IS_ERR(qdwc->iface_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get iface clock, skipping\n");
> +		qdwc->iface_clk = NULL;

so this clock and sleep_clk are optional, that's fine...

> +	}
> +
> +	qdwc->sleep_clk = devm_clk_get(qdwc->dev, "sleep");
> +	if (IS_ERR(qdwc->sleep_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get sleep clock, skipping\n");
> +		qdwc->sleep_clk = NULL;
> +	}
> +
> +	if (!IS_ERR(qdwc->gdsc)) {
> +		ret = regulator_enable(qdwc->gdsc);
> +		if (ret)
> +			dev_err(qdwc->dev, "cannot enable gdsc\n");
> +	}
> +
> +	clk_prepare_enable(qdwc->core_clk);
> +
> +	if (qdwc->iface_clk)
> +		clk_prepare_enable(qdwc->iface_clk);

... right here you can drop the NULL check because clk_prepare_enable()
is safe against NULL pointers.

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140630/6fa2844b/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: Andy Gross <agross@codeaurora.org>
Cc: Felipe Balbi <balbi@ti.com>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	"Ivan T. Ivanov" <iivanov@mm-sol.com>,
	<linux-arm-kernel@lists.infradead.org>,
	Kumar Gala <galak@codeaurora.org>, <jackp@codeaurora.org>,
	<linux-arm-msm@vger.kernel.org>
Subject: Re: [Patch v7 1/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver
Date: Mon, 30 Jun 2014 11:52:52 -0500	[thread overview]
Message-ID: <20140630165252.GC31442@saruman.home> (raw)
In-Reply-To: <1404144233-17222-2-git-send-email-agross@codeaurora.org>

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

Hi,

On Mon, Jun 30, 2014 at 11:03:51AM -0500, Andy Gross wrote:
> +static int dwc3_qcom_probe(struct platform_device *pdev)
> +{
> +	struct device_node *node = pdev->dev.of_node;
> +	struct dwc3_qcom *qdwc;
> +	int ret = 0;
> +
> +	qdwc = devm_kzalloc(&pdev->dev, sizeof(*qdwc), GFP_KERNEL);
> +	if (!qdwc)
> +		return -ENOMEM;
> +
> +	platform_set_drvdata(pdev, qdwc);
> +
> +	qdwc->dev = &pdev->dev;
> +
> +	qdwc->gdsc = devm_regulator_get(qdwc->dev, "gdsc");
> +
> +	qdwc->core_clk = devm_clk_get(qdwc->dev, "core");
> +	if (IS_ERR(qdwc->core_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get core clock\n");
> +		return PTR_ERR(qdwc->core_clk);
> +	}
> +
> +	qdwc->iface_clk = devm_clk_get(qdwc->dev, "iface");
> +	if (IS_ERR(qdwc->iface_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get iface clock, skipping\n");
> +		qdwc->iface_clk = NULL;

so this clock and sleep_clk are optional, that's fine...

> +	}
> +
> +	qdwc->sleep_clk = devm_clk_get(qdwc->dev, "sleep");
> +	if (IS_ERR(qdwc->sleep_clk)) {
> +		dev_dbg(qdwc->dev, "failed to get sleep clock, skipping\n");
> +		qdwc->sleep_clk = NULL;
> +	}
> +
> +	if (!IS_ERR(qdwc->gdsc)) {
> +		ret = regulator_enable(qdwc->gdsc);
> +		if (ret)
> +			dev_err(qdwc->dev, "cannot enable gdsc\n");
> +	}
> +
> +	clk_prepare_enable(qdwc->core_clk);
> +
> +	if (qdwc->iface_clk)
> +		clk_prepare_enable(qdwc->iface_clk);

... right here you can drop the NULL check because clk_prepare_enable()
is safe against NULL pointers.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-06-30 16:53 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 16:03 [Patch v7 0/3] DWC3 USB support for Qualcomm platform Andy Gross
2014-06-30 16:03 ` Andy Gross
2014-06-30 16:03 ` [Patch v7 1/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver Andy Gross
2014-06-30 16:03   ` Andy Gross
2014-06-30 16:52   ` Felipe Balbi [this message]
2014-06-30 16:52     ` Felipe Balbi
2014-06-30 16:52     ` Felipe Balbi
2014-07-18  2:10   ` Jingoo Han
2014-07-18  2:10     ` Jingoo Han
2014-06-30 16:03 ` [Patch v7 2/3] usb: phy: Add Qualcomm DWC3 HS/SS PHY drivers Andy Gross
2014-06-30 16:03   ` Andy Gross
2014-06-30 17:00   ` Felipe Balbi
2014-06-30 17:00     ` Felipe Balbi
2014-06-30 17:00     ` Felipe Balbi
     [not found]   ` <CA+neC=McWS8=iSi2XShJyvc85Aw4PSmF-osNpVgJv42d9or1WQ@mail.gmail.com>
2014-07-17 10:30     ` kiran.padwal
2014-07-17 10:30       ` kiran.padwal
2014-07-17 10:30       ` kiran.padwal at smartplayin.com
     [not found]       ` <1405593024.423213197-0ZYIasU8DW2IAIbY1eLdq9BPR1lH4CV8@public.gmane.org>
2014-07-17 18:28         ` Andy Gross
2014-07-17 18:28           ` Andy Gross
2014-07-17 18:28           ` Andy Gross
2014-06-30 16:03 ` [Patch v7 3/3] usb: dwc3: qcom: Add device tree binding Andy Gross
2014-06-30 16:03   ` Andy Gross
2014-06-30 17:37   ` Kumar Gala
2014-06-30 17:37     ` Kumar Gala
2014-07-01  5:04   ` Rob Herring
2014-07-01  5:04     ` Rob Herring
2014-07-01 18:01     ` Andy Gross
2014-07-01 18:01       ` Andy Gross
2014-07-01 19:47       ` Rob Herring
2014-07-01 19:47         ` Rob Herring
2014-07-02  8:43         ` Ivan T. Ivanov
2014-07-02  8:43           ` Ivan T. Ivanov
2014-07-02 12:48           ` Arnd Bergmann
2014-07-02 12:48             ` Arnd Bergmann
2014-07-02 15:54             ` Felipe Balbi
2014-07-02 15:54               ` Felipe Balbi
2014-07-02 15:54               ` Felipe Balbi

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=20140630165252.GC31442@saruman.home \
    --to=balbi@ti.com \
    --cc=agross@codeaurora.org \
    --cc=galak@codeaurora.org \
    --cc=iivanov@mm-sol.com \
    --cc=jackp@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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.