thermal: Use dev_err_probe() for direct probe errors
PATCH 1/1 thermal: Use dev_err_probe() for direct probe errors
Replace the open-coded dev_err() and PTR_ERR() return sequences in the thermal MMIO and UniPhier probe paths with dev_err_probe(). This preserves the original probe error while providing standardized symbolic error logging and deferred-probe handling.
No functional change intended.
Signed-off-by Sumeet Pawnikar <[email protected]>
--- drivers/thermal/thermal_mmio.c | 9 +++------ drivers/thermal/uniphier_thermal.c | 8 +++----- 2 files changed, 6 insertions(+), 11 deletions(-)
drivers/thermal/thermal_mmio.c +3 -6
@@ -69,12 +69,9 @@ static int thermal_mmio_probe(struct platform_device *pdev)0 , sensor, &thermal_mmio_ops); -if (IS_ERR (thermal_zone)) { -dev_err (&pdev->dev, -"failed to register sensor (%ld)\n" , -PTR_ERR (thermal_zone)); -return PTR_ERR (thermal_zone); - } +if (IS_ERR (thermal_zone)) +return dev_err_probe (&pdev->dev,PTR_ERR (thermal_zone), +"failed to register sensor\n" );thermal_mmio_get_temperature (thermal_zone, &temperature); dev_info(&pdev->dev,
drivers/thermal/uniphier_thermal.c +3 -5
@@ -285,11 +285,9 @@ static int uniphier_tm_probe(struct platform_device *pdev) parent =of_get_parent (dev->of_node);/* parent should be syscon node */ regmap =syscon_node_to_regmap (parent);of_node_put (parent); -if (IS_ERR (regmap)) { -dev_err (dev,"failed to get regmap (error %ld)\n" , -PTR_ERR (regmap)); -return PTR_ERR (regmap); - } +if (IS_ERR (regmap)) +return dev_err_probe (dev,PTR_ERR (regmap), +"failed to get regmap\n" ); tdev->regmap = regmap; ret =uniphier_tm_initialize_sensor (tdev);
Signature · 1 line
2.53.0