From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750980AbdLGHFy (ORCPT ); Thu, 7 Dec 2017 02:05:54 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:51932 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750738AbdLGHFw (ORCPT ); Thu, 7 Dec 2017 02:05:52 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9F8C4600C7 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org Date: Wed, 6 Dec 2017 23:05:50 -0800 From: Stephen Boyd To: Xu YiPing Cc: mturquette@baylibre.com, robh+dt@kernel.org, mark.rutland@arm.com, xuwei5@hisilicon.com, catalin.marinas@arm.com, will.deacon@arm.com, xuejiancheng@hisilicon.com, wenpan@hisilicon.com, leo.yan@linaro.org, zhangfei.gao@linaro.org, guodong.xu@linaro.org, zhongkaihua@huawei.com, chenjun14@huawei.com, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, suzhuangluan@hisilicon.com, xuezhiliang@hisilicon.com, kevin.wangtao@hisilicon.com Subject: Re: [PATCH v3 2/3] clk: hisilicon: Add support for Hi3660 stub clocks Message-ID: <20171207070550.GY4283@codeaurora.org> References: <1510910852-2175-1-git-send-email-xuyiping@hisilicon.com> <1510910852-2175-3-git-send-email-xuyiping@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510910852-2175-3-git-send-email-xuyiping@hisilicon.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/17, Xu YiPing wrote: > From: Kaihua Zhong > + > +static struct clk_hw *hi3660_stub_clk_hw_get(struct of_phandle_args *clkspec, > + void *data) > +{ > + unsigned int idx = clkspec->args[0]; > + > + if (idx > HI3660_CLK_STUB_NUM) { This should be >= > + } > + > + return &hi3660_stub_clks[idx].hw; > +} > + > +static int hi3660_stub_clk_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct resource *res; > + unsigned int i; > + int ret; > + > + /* Use mailbox client without blocking */ > + stub_clk_chan.cl.dev = dev; > + stub_clk_chan.cl.tx_done = NULL; > + stub_clk_chan.cl.tx_block = false; > + stub_clk_chan.cl.knows_txdone = false; > + > + /* Allocate mailbox channel */ > + stub_clk_chan.mbox = mbox_request_channel(&stub_clk_chan.cl, 0); > + if (IS_ERR(stub_clk_chan.mbox)) > + return PTR_ERR(stub_clk_chan.mbox); > + > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + freq_reg = devm_ioremap(dev, res->start, resource_size(res)); > + if (IS_ERR(freq_reg)) Pretty sure this returns NULL on failure, not an error pointer. > + return -ENOMEM; > + > + freq_reg += HI3660_STUB_CLOCK_DATA; > + > + for (i = 0; i < HI3660_CLK_STUB_NUM; i++) { > + ret = devm_clk_hw_register(&pdev->dev, &hi3660_stub_clks[i].hw); > + if (ret) > + return ret; > + } > + > + ret = of_clk_add_hw_provider(pdev->dev.of_node, hi3660_stub_clk_hw_get, > + hi3660_stub_clks); This can use devm > + return ret; > +} > + I fixed it all and merged into clk-next. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project