Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: staging: media: imx6-mipi-csi2: use devm_mutex_init() to simplify code

Use devm_mutex_init() to simplify the code. No functional change.

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/20260116-stage-csi2-cleanup-v2-2-a56e9cb25196@nxp.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Frank Li and committed by
Hans Verkuil
2da4207d 7ce92f35

+4 -5
+4 -5
drivers/staging/media/imx/imx6-mipi-csi2.c
··· 777 777 if (!csi2->base) 778 778 return -ENOMEM; 779 779 780 - mutex_init(&csi2->lock); 780 + ret = devm_mutex_init(&pdev->dev, &csi2->lock); 781 + if (ret) 782 + return ret; 781 783 782 784 ret = clk_prepare_enable(csi2->pllref_clk); 783 785 if (ret) { 784 786 v4l2_err(&csi2->sd, "failed to enable pllref_clk\n"); 785 - goto rmmutex; 787 + return ret; 786 788 } 787 789 788 790 ret = clk_prepare_enable(csi2->dphy_clk); ··· 807 805 clk_disable_unprepare(csi2->dphy_clk); 808 806 pllref_off: 809 807 clk_disable_unprepare(csi2->pllref_clk); 810 - rmmutex: 811 - mutex_destroy(&csi2->lock); 812 808 return ret; 813 809 } 814 810 ··· 820 820 v4l2_async_unregister_subdev(sd); 821 821 clk_disable_unprepare(csi2->dphy_clk); 822 822 clk_disable_unprepare(csi2->pllref_clk); 823 - mutex_destroy(&csi2->lock); 824 823 media_entity_cleanup(&sd->entity); 825 824 } 826 825