aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pwm-fan.c
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2019-04-12 10:05:23 -0400
committerGuenter Roeck <linux@roeck-us.net>2019-04-15 20:19:53 -0400
commit841cf6767bf6eb047fb8ede6c2a2d50976ec5ec9 (patch)
tree42a12763d22a99930b752db4de5663b218d77f93 /drivers/hwmon/pwm-fan.c
parent6b1ec4789fb17890a7f95e72670a9393fd9f8c8f (diff)
hwmon: (pwm-fan) Report probe errors consistently
Printing the error code for a failure provides a head-start for debugging, since it's often sufficient to pinpoint the origin of the failure. We already do this for some probe-failure messages, so let's make the rest of them consistent. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pwm-fan.c')
-rw-r--r--drivers/hwmon/pwm-fan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index 285ec3abb85e..eead8afe6447 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -328,7 +328,7 @@ static int pwm_fan_probe(struct platform_device *pdev)
328 328
329 ret = pwm_apply_state(ctx->pwm, &state); 329 ret = pwm_apply_state(ctx->pwm, &state);
330 if (ret) { 330 if (ret) {
331 dev_err(&pdev->dev, "Failed to configure PWM\n"); 331 dev_err(&pdev->dev, "Failed to configure PWM: %d\n", ret);
332 goto err_reg_disable; 332 goto err_reg_disable;
333 } 333 }
334 334
@@ -346,7 +346,8 @@ static int pwm_fan_probe(struct platform_device *pdev)
346 ret = devm_request_irq(&pdev->dev, ctx->irq, pulse_handler, 0, 346 ret = devm_request_irq(&pdev->dev, ctx->irq, pulse_handler, 0,
347 pdev->name, ctx); 347 pdev->name, ctx);
348 if (ret) { 348 if (ret) {
349 dev_err(&pdev->dev, "Can't get interrupt working.\n"); 349 dev_err(&pdev->dev,
350 "Failed to request interrupt: %d\n", ret);
350 goto err_pwm_disable; 351 goto err_pwm_disable;
351 } 352 }
352 ctx->sample_start = ktime_get(); 353 ctx->sample_start = ktime_get();
@@ -356,8 +357,9 @@ static int pwm_fan_probe(struct platform_device *pdev)
356 hwmon = devm_hwmon_device_register_with_groups(&pdev->dev, "pwmfan", 357 hwmon = devm_hwmon_device_register_with_groups(&pdev->dev, "pwmfan",
357 ctx, pwm_fan_groups); 358 ctx, pwm_fan_groups);
358 if (IS_ERR(hwmon)) { 359 if (IS_ERR(hwmon)) {
359 dev_err(&pdev->dev, "Failed to register hwmon device\n");
360 ret = PTR_ERR(hwmon); 360 ret = PTR_ERR(hwmon);
361 dev_err(&pdev->dev,
362 "Failed to register hwmon device: %d\n", ret);
361 goto err_del_timer; 363 goto err_del_timer;
362 } 364 }
363 365
@@ -371,9 +373,10 @@ static int pwm_fan_probe(struct platform_device *pdev)
371 "pwm-fan", ctx, 373 "pwm-fan", ctx,
372 &pwm_fan_cooling_ops); 374 &pwm_fan_cooling_ops);
373 if (IS_ERR(cdev)) { 375 if (IS_ERR(cdev)) {
374 dev_err(&pdev->dev,
375 "Failed to register pwm-fan as cooling device");
376 ret = PTR_ERR(cdev); 376 ret = PTR_ERR(cdev);
377 dev_err(&pdev->dev,
378 "Failed to register pwm-fan as cooling device: %d\n",
379 ret);
377 goto err_del_timer; 380 goto err_del_timer;
378 } 381 }
379 ctx->cdev = cdev; 382 ctx->cdev = cdev;