[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <649a8d88-0504-5aa9-d167-d25d394f3f26@linaro.org>
Date: Thu, 16 Feb 2023 12:02:36 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Shradha Todi <shradha.t@...sung.com>, lpieralisi@...nel.org,
kw@...ux.com, robh@...nel.org, bhelgaas@...gle.com,
krzysztof.kozlowski+dt@...aro.org, alim.akhtar@...sung.com,
jingoohan1@...il.com, Sergey.Semin@...kalelectronics.ru,
lukas.bulwahn@...il.com, hongxing.zhu@....com, tglx@...utronix.de,
m.szyprowski@...sung.com, jh80.chung@...sung.co,
pankaj.dubey@...sung.com
Cc: linux-pci@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/16] PCI: samsung: Use clock bulk API to get clocks
On 14/02/2023 13:13, Shradha Todi wrote:
> Adopt to clock bulk API to handle clocks.
>
> Signed-off-by: Shradha Todi <shradha.t@...sung.com>
> ---
> drivers/pci/controller/dwc/pci-samsung.c | 46 ++++++------------------
> 1 file changed, 11 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-samsung.c b/drivers/pci/controller/dwc/pci-samsung.c
> index cfe384aee754..6c07d3f151be 100644
> --- a/drivers/pci/controller/dwc/pci-samsung.c
> +++ b/drivers/pci/controller/dwc/pci-samsung.c
> @@ -54,8 +54,8 @@
> struct exynos_pcie {
> struct dw_pcie pci;
> void __iomem *elbi_base;
> - struct clk *clk;
> - struct clk *bus_clk;
> + struct clk_bulk_data *clks;
> + int clk_cnt;
> struct phy *phy;
> struct regulator_bulk_data supplies[2];
> };
> @@ -65,30 +65,18 @@ static int exynos_pcie_init_clk_resources(struct exynos_pcie *ep)
> struct device *dev = ep->pci.dev;
> int ret;
>
> - ret = clk_prepare_enable(ep->clk);
> - if (ret) {
> - dev_err(dev, "cannot enable pcie rc clock");
> + ret = devm_clk_bulk_get_all(dev, &ep->clks);
> + if (ret < 0)
> return ret;
> - }
>
> - ret = clk_prepare_enable(ep->bus_clk);
> - if (ret) {
> - dev_err(dev, "cannot enable pcie bus clock");
> - goto err_bus_clk;
> - }
> + ep->clk_cnt = ret;
I think this misses check if you got two clocks.
Best regards,
Krzysztof
Powered by blists - more mailing lists