aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-k210.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2021-08-30 09:49:59 -0300
committerJason Gunthorpe <jgg@nvidia.com>2021-08-30 09:49:59 -0300
commit6a217437f9f5482a3f6f2dc5fcd27cf0f62409ac (patch)
treec82270181daeb43eb9984b586784b70f13ef1df4 /drivers/pinctrl/pinctrl-k210.c
parentRDMA/mlx5: Relax DCS QP creation checks (diff)
parentRDMA: Use the sg_table directly and remove the opencoded version from umem (diff)
downloadlinux-dev-6a217437f9f5482a3f6f2dc5fcd27cf0f62409ac.tar.xz
linux-dev-6a217437f9f5482a3f6f2dc5fcd27cf0f62409ac.zip
Merge branch 'sg_nents' into rdma.git for-next
From Maor Gottlieb ==================== Fix the use of nents and orig_nents in the sg table append helpers. The nents should be used by the DMA layer to store the number of DMA mapped sges, the orig_nents is the number of CPU sges. Since the sg append logic doesn't always create a SGL with exactly orig_nents entries store a total_nents as well to allow the table to be properly free'd and reorganize the freeing logic to share across all the use cases. ==================== Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> * 'sg_nents': RDMA: Use the sg_table directly and remove the opencoded version from umem lib/scatterlist: Fix wrong update of orig_nents lib/scatterlist: Provide a dedicated function to support table append
Diffstat (limited to 'drivers/pinctrl/pinctrl-k210.c')
-rw-r--r--drivers/pinctrl/pinctrl-k210.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c
index f831526d06ff..49e32684dbb2 100644
--- a/drivers/pinctrl/pinctrl-k210.c
+++ b/drivers/pinctrl/pinctrl-k210.c
@@ -950,23 +950,37 @@ static int k210_fpioa_probe(struct platform_device *pdev)
return ret;
pdata->pclk = devm_clk_get_optional(dev, "pclk");
- if (!IS_ERR(pdata->pclk))
- clk_prepare_enable(pdata->pclk);
+ if (!IS_ERR(pdata->pclk)) {
+ ret = clk_prepare_enable(pdata->pclk);
+ if (ret)
+ goto disable_clk;
+ }
pdata->sysctl_map =
syscon_regmap_lookup_by_phandle_args(np,
"canaan,k210-sysctl-power",
1, &pdata->power_offset);
- if (IS_ERR(pdata->sysctl_map))
- return PTR_ERR(pdata->sysctl_map);
+ if (IS_ERR(pdata->sysctl_map)) {
+ ret = PTR_ERR(pdata->sysctl_map);
+ goto disable_pclk;
+ }
k210_fpioa_init_ties(pdata);
pdata->pctl = pinctrl_register(&k210_pinctrl_desc, dev, (void *)pdata);
- if (IS_ERR(pdata->pctl))
- return PTR_ERR(pdata->pctl);
+ if (IS_ERR(pdata->pctl)) {
+ ret = PTR_ERR(pdata->pctl);
+ goto disable_pclk;
+ }
return 0;
+
+disable_pclk:
+ clk_disable_unprepare(pdata->pclk);
+disable_clk:
+ clk_disable_unprepare(pdata->clk);
+
+ return ret;
}
static const struct of_device_id k210_fpioa_dt_ids[] = {