Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1256750 > unrolled thread
| Started by | Robin Murphy <robin.murphy@arm.com> |
|---|---|
| First post | 2015-10-27 14:30 +0100 |
| Last post | 2015-10-31 09:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v5 4/6] memory: mediatek: Add SMI driver Robin Murphy <robin.murphy@arm.com> - 2015-10-27 14:30 +0100
Re: [PATCH v5 4/6] memory: mediatek: Add SMI driver Yong Wu <yong.wu@mediatek.com> - 2015-10-31 09:40 +0100
| From | Robin Murphy <robin.murphy@arm.com> |
|---|---|
| Date | 2015-10-27 14:30 +0100 |
| Subject | Re: [PATCH v5 4/6] memory: mediatek: Add SMI driver |
| Message-ID | <qocu6-5HZ-9@gated-at.bofh.it> |
On 09/10/15 03:23, Yong Wu wrote:
[...]
> +static int mtk_smi_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct mtk_smi_data *smidata;
> + int ret;
> +
> + if (!dev->pm_domain)
> + return -EPROBE_DEFER;
> +
> + smidata = devm_kzalloc(dev, sizeof(*smidata), GFP_KERNEL);
> + if (!smidata)
> + return -ENOMEM;
> +
> + smidata->clk_apb = devm_clk_get(dev, "apb");
> + if (IS_ERR(smidata->clk_apb))
> + return PTR_ERR(smidata->clk_apb);
> +
> + smidata->clk_smi = devm_clk_get(dev, "smi");
> + if (IS_ERR(smidata->clk_smi))
> + return PTR_ERR(smidata->clk_smi);
> +
> + pm_runtime_enable(dev);
> + dev_set_drvdata(dev, smidata);
> + return ret;
ret is used uninitialised here, but you might as well just "return 0;"
and get rid of the variable entirely.
> +}
Robin.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Yong Wu <yong.wu@mediatek.com> |
|---|---|
| Date | 2015-10-31 09:40 +0100 |
| Message-ID | <qpzRD-yn-9@gated-at.bofh.it> |
| In reply to | #1256750 |
On Tue, 2015-10-27 at 13:24 +0000, Robin Murphy wrote:
> On 09/10/15 03:23, Yong Wu wrote:
> [...]
> > +static int mtk_smi_probe(struct platform_device *pdev)
> > +{
> > + struct device *dev = &pdev->dev;
> > + struct mtk_smi_data *smidata;
> > + int ret;
> > +
> > + if (!dev->pm_domain)
> > + return -EPROBE_DEFER;
> > +
> > + smidata = devm_kzalloc(dev, sizeof(*smidata), GFP_KERNEL);
> > + if (!smidata)
> > + return -ENOMEM;
> > +
> > + smidata->clk_apb = devm_clk_get(dev, "apb");
> > + if (IS_ERR(smidata->clk_apb))
> > + return PTR_ERR(smidata->clk_apb);
> > +
> > + smidata->clk_smi = devm_clk_get(dev, "smi");
> > + if (IS_ERR(smidata->clk_smi))
> > + return PTR_ERR(smidata->clk_smi);
> > +
> > + pm_runtime_enable(dev);
> > + dev_set_drvdata(dev, smidata);
> > + return ret;
>
> ret is used uninitialised here, but you might as well just "return 0;"
> and get rid of the variable entirely.
Thanks. I will change to "return 0" directly.
>
> > +}
>
> Robin.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web