Skip to content

Commit 89c8397

Browse files
committed
Merge tag 'omap-for-v5.19/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc
Soc clean-up for omaps Soc clean-up for omaps to add missing of_node_put() calls and drop unused omap_device_register(). * tag 'omap-for-v5.19/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP2+: drop hwmod-clock helper comment ARM: OMAP2+: drop omap_device_register() helper ARM: OMAP2+: add missing of_node_put before break and return Link: https://lore.kernel.org/r/pull-1651061256-836848@atomide.com-3 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents b2d229d + df3eb1f commit 89c8397

5 files changed

Lines changed: 26 additions & 30 deletions

File tree

arch/arm/mach-omap2/cm_common.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,10 @@ int __init omap2_cm_base_init(void)
320320
data = (struct omap_prcm_init_data *)match->data;
321321

322322
ret = of_address_to_resource(np, 0, &res);
323-
if (ret)
323+
if (ret) {
324+
of_node_put(np);
324325
return ret;
326+
}
325327

326328
if (data->index == TI_CLKM_CM)
327329
mem = &cm_base;
@@ -367,8 +369,10 @@ int __init omap_cm_init(void)
367369
continue;
368370

369371
ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
370-
if (ret)
372+
if (ret) {
373+
of_node_put(np);
371374
return ret;
375+
}
372376
}
373377

374378
return 0;

arch/arm/mach-omap2/control.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,10 @@ int __init omap2_control_base_init(void)
769769
data = (struct control_init_data *)match->data;
770770

771771
mem = of_iomap(np, 0);
772-
if (!mem)
772+
if (!mem) {
773+
of_node_put(np);
773774
return -ENOMEM;
775+
}
774776

775777
if (data->index == TI_CLKM_CTRL) {
776778
omap2_ctrl_base = mem;
@@ -810,22 +812,24 @@ int __init omap_control_init(void)
810812
if (scm_conf) {
811813
syscon = syscon_node_to_regmap(scm_conf);
812814

813-
if (IS_ERR(syscon))
814-
return PTR_ERR(syscon);
815+
if (IS_ERR(syscon)) {
816+
ret = PTR_ERR(syscon);
817+
goto of_node_put;
818+
}
815819

816820
if (of_get_child_by_name(scm_conf, "clocks")) {
817821
ret = omap2_clk_provider_init(scm_conf,
818822
data->index,
819823
syscon, NULL);
820824
if (ret)
821-
return ret;
825+
goto of_node_put;
822826
}
823827
} else {
824828
/* No scm_conf found, direct access */
825829
ret = omap2_clk_provider_init(np, data->index, NULL,
826830
data->mem);
827831
if (ret)
828-
return ret;
832+
goto of_node_put;
829833
}
830834
}
831835

@@ -836,6 +840,11 @@ int __init omap_control_init(void)
836840
}
837841

838842
return 0;
843+
844+
of_node_put:
845+
of_node_put(np);
846+
return ret;
847+
839848
}
840849

841850
/**

arch/arm/mach-omap2/omap_device.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
9696
* omap_device, this function adds an entry in the clkdev table of the
9797
* form <dev-id=dev_name, con-id=role> if it does not exist already.
9898
*
99-
* The function is called from inside omap_device_build_ss(), after
100-
* omap_device_register.
101-
*
10299
* This allows drivers to get a pointer to its optional clocks based on its role
103100
* by calling clk_get(<dev*>, <role>).
104101
* In the case of the main clock, a "fck" alias is used.
@@ -473,23 +470,6 @@ struct dev_pm_domain omap_device_pm_domain = {
473470
}
474471
};
475472

476-
/**
477-
* omap_device_register - register an omap_device with one omap_hwmod
478-
* @pdev: the platform device (omap_device) to register.
479-
*
480-
* Register the omap_device structure. This currently just calls
481-
* platform_device_register() on the underlying platform_device.
482-
* Returns the return value of platform_device_register().
483-
*/
484-
int omap_device_register(struct platform_device *pdev)
485-
{
486-
pr_debug("omap_device: %s: registering\n", pdev->name);
487-
488-
dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain);
489-
return platform_device_add(pdev);
490-
}
491-
492-
493473
/* Public functions for use by device drivers through struct platform_data */
494474

495475
/**

arch/arm/mach-omap2/omap_device.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ int omap_device_idle(struct platform_device *pdev);
7171
struct omap_device *omap_device_alloc(struct platform_device *pdev,
7272
struct omap_hwmod **ohs, int oh_cnt);
7373
void omap_device_delete(struct omap_device *od);
74-
int omap_device_register(struct platform_device *pdev);
7574

7675
struct device *omap_device_get_by_hwmod_name(const char *oh_name);
7776

arch/arm/mach-omap2/prm_common.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,10 @@ int __init omap2_prm_base_init(void)
752752
data = (struct omap_prcm_init_data *)match->data;
753753

754754
ret = of_address_to_resource(np, 0, &res);
755-
if (ret)
755+
if (ret) {
756+
of_node_put(np);
756757
return ret;
758+
}
757759

758760
data->mem = ioremap(res.start, resource_size(&res));
759761

@@ -799,8 +801,10 @@ int __init omap_prcm_init(void)
799801
data = match->data;
800802

801803
ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
802-
if (ret)
804+
if (ret) {
805+
of_node_put(np);
803806
return ret;
807+
}
804808
}
805809

806810
omap_cm_init();

0 commit comments

Comments
 (0)