Re: [PATCH v5 4/6] memory: mediatek: Add SMI driver
From: Yong Wu <hidden>
Date: 2015-10-31 08:32:40
Also in:
linux-arm-kernel, linux-iommu, linux-mediatek, lkml
From: Yong Wu <hidden>
Date: 2015-10-31 08:32:40
Also in:
linux-arm-kernel, linux-iommu, linux-mediatek, lkml
On Tue, 2015-10-27 at 13:24 +0000, Robin Murphy wrote:
On 09/10/15 03:23, Yong Wu wrote: [...]quoted
+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.
quoted
+}Robin.
-- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html