clk: Use of_device_get_match_data()
PATCH 1/1 clk: Use of_device_get_match_data()
From: Minghao Chi (CGEL ZTE) <[email protected]>
Use of_device_get_match_data() to simplify the code.
Reported-by Zeal Robot <[email protected]>
Signed-off-by Minghao Chi (CGEL ZTE) <[email protected]>
--- drivers/clk/clk-oxnas.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/clk/clk-oxnas.c +1 -5
@@ -209,15 +209,11 @@ static int oxnas_stdclk_probe(struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node;const struct oxnas_stdclk_data *data; -const struct of_device_id *id;struct regmap *regmap;int ret;int i; - id =of_match_device (oxnas_stdclk_dt_ids, &pdev->dev); -if (!id) -return -ENODEV ; - data = id->data; + data =of_device_get_match_data (&pdev->dev); regmap =syscon_node_to_regmap (of_get_parent (np));if (IS_ERR (regmap)) {
Signature · 1 line
2.25.1
Quoted 21 lines · On 03/03/2022 02:48, [email protected] wrote:
From: Minghao Chi (CGEL ZTE) <[email protected]>
Use
of_device_get_match_data()to simplify the code.Reported-by Zeal Robot <[email protected]>Signed-off-by Minghao Chi (CGEL ZTE) <[email protected]>--- drivers/clk/clk-oxnas.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/clk/clk-oxnas.c +0
-1@@ -209,15 +209,11 @@ static int oxnas_stdclk_probe(struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node;const struct oxnas_stdclk_data *data; -const struct of_device_id *id;struct regmap *regmap;int ret;
drivers/clk/clk-oxnas.c static int oxnas_stdclk_probe(struct platform_device *pdev) · line 219
Quoted 10 lines
drivers/clk/clk-oxnas.c +1
-4int i; - id =of_match_device (oxnas_stdclk_dt_ids, &pdev->dev); -if (!id) -return -ENODEV ; - data = id->data; + data =of_device_get_match_data (&pdev->dev); regmap =syscon_node_to_regmap (of_get_parent (np));if (IS_ERR (regmap)) {
Acked-by Neil Armstrong <[email protected]>
Quoting [email protected] (2022-03-02 17:48:56)
Quoted 7 lines
From: Minghao Chi (CGEL ZTE) <[email protected]>
Use
of_device_get_match_data()to simplify the code.Reported-by Zeal Robot <[email protected]>Signed-off-by Minghao Chi (CGEL ZTE) <[email protected]>---
Applied to clk-next