Soc clean-up for omaps
Soc clean-up for omaps to add missing of_node_put() calls and drop unused omap_device_register(). -----BEGIN PGP SIGNATURE----- iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAmJnr6oRHHRvbnlAYXRv bWlkZS5jb20ACgkQG9Q+yVyrpXPCHw//eTxYNP9SEviSy/yqiD73C9D4J8LWc24c aeeGSko10qtNBIjMVfszrNRPY5OqXFngekcI+5STJfDKGz+g8oST6HxHHafkAVt8 jUIyFkWChGGzBGeiocnuX1zqHwk09EBTWU1JLi/6hf/XA5qVvnlSX1FPRyE7XDHA 6qsECxlOCxq5InCdvDL/feET1KJiUKpjhavytHLKIAIrmvUl/OtLwPhn9YvttOJ8 3/ucGnyE+ZzcA45Vf56CISLlrYv8/b/KV8MSei9mXcIPGmED2O275la9JmSNuY/q XUBIBfHG0kCoifa0PyfLdYlUDnn6sPtPQhOicb7Yzq1MQQA4JDrypvCgIEhfe953 UjbH7Oe/C0Jv8Qn8CxoqO3KaDKze7U6RMcM//qEXoHXLiX0IJwp/YJGpQIszvb1O +5ktjRvXIzW7UuQi2ZscrKuIolG70zLonAR2qoxV9yi8zaYkf7aAYfr/hgF1TfNK +PVvYUawaBl2Q3LH9L5NeZZmSaoyv2acrIi2F0U1ensO35wlcPRmhOLhdOXurLFq 1ErfAF3Z54iVl7BDltXWESidZ5S7+waM+b74rJTvidtxEk0njOa8jEA9nuKIO/8e 23kL9GZAX6R39dZ1U+ucQYAlzaXkw8kT8Cff3EEjbefzb1sqdoMLTiYalgjTOth6 WJWwhXh4h6o= =9sVu -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmJxPgUACgkQmmx57+YA GNlDCA//WEiFaLQ0kazLQdgM4bKIeQ9QHrY3MG8Pb3DzrKwpgCWgWLPU2F+Cm8PS rf7OJbHBWbnoHqFepC8ebthd7/wBdO0qS6G6y+gqUzjlNayE4P3PBopPSdVD3z+N e4V5t0MDRHWBVPPAlQ7Oe6aiCA+4Jm7ZGelvMTr8Kz5eHo02b3Yu/sUg+6/qObm9 IRUukWh/9R3oI2ETREnpRTrSNtqZ5eAFBeyjRL7DjEXn1dQWv1PPQ/j2VJ+cAEPK xMzLgLsHkKqvGIxvMA8GSXgsq12C1ODixUSrXjMd1AyHs8ip8m8j4TOgAG7lIZNx IaQEJt7Sp+lYZjS0Ub/kq01sYrYCZJ0merirjkcwacYSMycTbjEk76ck8CNFFaSf Sqp6plVtWXd7F5i0l60knwgwNDFJOgJlKpdEaO6lDQC/+KlTPBqaJlqdboS9E9s0 cXGXF825THi/EIlLTmwxpho+zWNRV0wB4kOqC89ojQjdUrH90lAn0MS2U3/8YW5p LBhNwefxpfliev/9/anDiloAQmpywnCaURvASqGFb0q9M6lWaxPp9+nnDJlobPch 2qqR7A7RXmKG21XPB0u7KU0ggNeuYZxa+7WatqZdj0maMpIv8evXrsL7mkCO4gSH K17hggRqdKEZR/97S+6L/lKUl/etosJEDqUe/RL1SaQ0CkROPgI= =jSM7 -----END PGP SIGNATURE----- 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>
This commit is contained in:
commit
89c839720c
|
@ -320,8 +320,10 @@ int __init omap2_cm_base_init(void)
|
||||||
data = (struct omap_prcm_init_data *)match->data;
|
data = (struct omap_prcm_init_data *)match->data;
|
||||||
|
|
||||||
ret = of_address_to_resource(np, 0, &res);
|
ret = of_address_to_resource(np, 0, &res);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
of_node_put(np);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (data->index == TI_CLKM_CM)
|
if (data->index == TI_CLKM_CM)
|
||||||
mem = &cm_base;
|
mem = &cm_base;
|
||||||
|
@ -367,8 +369,10 @@ int __init omap_cm_init(void)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
|
ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
of_node_put(np);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -769,8 +769,10 @@ int __init omap2_control_base_init(void)
|
||||||
data = (struct control_init_data *)match->data;
|
data = (struct control_init_data *)match->data;
|
||||||
|
|
||||||
mem = of_iomap(np, 0);
|
mem = of_iomap(np, 0);
|
||||||
if (!mem)
|
if (!mem) {
|
||||||
|
of_node_put(np);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
if (data->index == TI_CLKM_CTRL) {
|
if (data->index == TI_CLKM_CTRL) {
|
||||||
omap2_ctrl_base = mem;
|
omap2_ctrl_base = mem;
|
||||||
|
@ -810,22 +812,24 @@ int __init omap_control_init(void)
|
||||||
if (scm_conf) {
|
if (scm_conf) {
|
||||||
syscon = syscon_node_to_regmap(scm_conf);
|
syscon = syscon_node_to_regmap(scm_conf);
|
||||||
|
|
||||||
if (IS_ERR(syscon))
|
if (IS_ERR(syscon)) {
|
||||||
return PTR_ERR(syscon);
|
ret = PTR_ERR(syscon);
|
||||||
|
goto of_node_put;
|
||||||
|
}
|
||||||
|
|
||||||
if (of_get_child_by_name(scm_conf, "clocks")) {
|
if (of_get_child_by_name(scm_conf, "clocks")) {
|
||||||
ret = omap2_clk_provider_init(scm_conf,
|
ret = omap2_clk_provider_init(scm_conf,
|
||||||
data->index,
|
data->index,
|
||||||
syscon, NULL);
|
syscon, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto of_node_put;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* No scm_conf found, direct access */
|
/* No scm_conf found, direct access */
|
||||||
ret = omap2_clk_provider_init(np, data->index, NULL,
|
ret = omap2_clk_provider_init(np, data->index, NULL,
|
||||||
data->mem);
|
data->mem);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto of_node_put;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -836,6 +840,11 @@ int __init omap_control_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
of_node_put:
|
||||||
|
of_node_put(np);
|
||||||
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -96,9 +96,6 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
|
||||||
* omap_device, this function adds an entry in the clkdev table of the
|
* omap_device, this function adds an entry in the clkdev table of the
|
||||||
* form <dev-id=dev_name, con-id=role> if it does not exist already.
|
* form <dev-id=dev_name, con-id=role> if it does not exist already.
|
||||||
*
|
*
|
||||||
* The function is called from inside omap_device_build_ss(), after
|
|
||||||
* omap_device_register.
|
|
||||||
*
|
|
||||||
* This allows drivers to get a pointer to its optional clocks based on its role
|
* This allows drivers to get a pointer to its optional clocks based on its role
|
||||||
* by calling clk_get(<dev*>, <role>).
|
* by calling clk_get(<dev*>, <role>).
|
||||||
* In the case of the main clock, a "fck" alias is used.
|
* In the case of the main clock, a "fck" alias is used.
|
||||||
|
@ -473,23 +470,6 @@ struct dev_pm_domain omap_device_pm_domain = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* omap_device_register - register an omap_device with one omap_hwmod
|
|
||||||
* @pdev: the platform device (omap_device) to register.
|
|
||||||
*
|
|
||||||
* Register the omap_device structure. This currently just calls
|
|
||||||
* platform_device_register() on the underlying platform_device.
|
|
||||||
* Returns the return value of platform_device_register().
|
|
||||||
*/
|
|
||||||
int omap_device_register(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
pr_debug("omap_device: %s: registering\n", pdev->name);
|
|
||||||
|
|
||||||
dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain);
|
|
||||||
return platform_device_add(pdev);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Public functions for use by device drivers through struct platform_data */
|
/* Public functions for use by device drivers through struct platform_data */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -71,7 +71,6 @@ int omap_device_idle(struct platform_device *pdev);
|
||||||
struct omap_device *omap_device_alloc(struct platform_device *pdev,
|
struct omap_device *omap_device_alloc(struct platform_device *pdev,
|
||||||
struct omap_hwmod **ohs, int oh_cnt);
|
struct omap_hwmod **ohs, int oh_cnt);
|
||||||
void omap_device_delete(struct omap_device *od);
|
void omap_device_delete(struct omap_device *od);
|
||||||
int omap_device_register(struct platform_device *pdev);
|
|
||||||
|
|
||||||
struct device *omap_device_get_by_hwmod_name(const char *oh_name);
|
struct device *omap_device_get_by_hwmod_name(const char *oh_name);
|
||||||
|
|
||||||
|
|
|
@ -752,8 +752,10 @@ int __init omap2_prm_base_init(void)
|
||||||
data = (struct omap_prcm_init_data *)match->data;
|
data = (struct omap_prcm_init_data *)match->data;
|
||||||
|
|
||||||
ret = of_address_to_resource(np, 0, &res);
|
ret = of_address_to_resource(np, 0, &res);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
of_node_put(np);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
data->mem = ioremap(res.start, resource_size(&res));
|
data->mem = ioremap(res.start, resource_size(&res));
|
||||||
|
|
||||||
|
@ -799,8 +801,10 @@ int __init omap_prcm_init(void)
|
||||||
data = match->data;
|
data = match->data;
|
||||||
|
|
||||||
ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
|
ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
of_node_put(np);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
omap_cm_init();
|
omap_cm_init();
|
||||||
|
|
Loading…
Reference in New Issue