Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp342535yba; Fri, 12 Apr 2019 04:51:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqytEWikWUeuhQ6+tCmWA8KgqKPQbs3L+Ao2PG3OWsdJJbrhv0HjWVyfTlQ1R9mXJ/qQgbJZ X-Received: by 2002:aa7:920b:: with SMTP id 11mr56270558pfo.3.1555069898235; Fri, 12 Apr 2019 04:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555069898; cv=none; d=google.com; s=arc-20160816; b=Kn9hpWuUsaXDGF6Gb0L2Mio3uGIzIL2FazFTJAi+w9bSP/5nPPYVqzyxvsJN9gaVsq MvT/TGEXy0eB9b0Q5zrSFoO/gb5dsJH6LSRc4YK63hKLA2dddUBC0SrP6VV+H6+d/HHC nSHwkds/vudwNKhENYFbCJFJVpIxFOqAH+mrlVR2PhM2xX8u0/Up/xcabpOkFPke893Z 7Q1iHeU9tZQaaUbXnRXM5ogy5Emv2Z/HU1a3mAAcBVmJbSBnT7yfn9KN0QgQiJy8lhmi GSCIlpUg9ULsJtS/c+++57Vf5Ws8TKHnh8+VduqzPkMd2es/nGQlZq2H+AKkXPlpGULA +Lug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=AEna2XTf45b6/ZvMYcShuuqpSpazKbXo35KvfzBrWSU=; b=jC3jh4U2kY7WPtBXh/skhOg+XI1ZpNSdNIsBXFn9RCjKt4hFTav4if9EbNSPKDEYqr WozDtQCgv8nRZy2gOxZEVzvUlxG7EEKMXW8SuTqMmSdh58Ox8t2tMZUA+sSbvc2dOgnT 3HQzPYsN3xAGIc6ckN66c8QZ0jJ6KvF3vxCOJYbX3Q1rjQFDenpHDvNCwNa1cb+ftQGc oEeb1Dvv6jzNkxJnGdEk876WRlQDZSUzlECVaJ6u83NzD4JE48XN3zhGLnr7kfOeR2Qi ejYqZbFM6GZOC/zj5+WH08jkpUVboKHI/uR1QxJcx7O3dO/jClGr8kg60mJAq89TkEeT W8OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si18912988pgt.271.2019.04.12.04.51.21; Fri, 12 Apr 2019 04:51:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727394AbfDLLun (ORCPT + 99 others); Fri, 12 Apr 2019 07:50:43 -0400 Received: from foss.arm.com ([217.140.101.70]:59096 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbfDLLum (ORCPT ); Fri, 12 Apr 2019 07:50:42 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 665C5374; Fri, 12 Apr 2019 04:50:42 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B65583F718; Fri, 12 Apr 2019 04:50:40 -0700 (PDT) From: Robin Murphy Subject: Re: [PATCH V5 3/3] hwmon: pwm-fan: Add RPM support via external interrupt To: Stefan Wahren , Guenter Roeck Cc: Kamil Debski , Bartlomiej Zolnierkiewicz , Jean Delvare , Rob Herring , Mark Rutland , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <1554989411-23666-1-git-send-email-stefan.wahren@i2se.com> <1554989411-23666-4-git-send-email-stefan.wahren@i2se.com> <20190411165742.GA29395@roeck-us.net> <019733e8-6b12-f5c1-e251-fd7eabe2891b@i2se.com> Message-ID: <77c56129-d3e7-1518-9d1d-a15a20540269@arm.com> Date: Fri, 12 Apr 2019 12:50:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <019733e8-6b12-f5c1-e251-fd7eabe2891b@i2se.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/04/2019 12:07, Stefan Wahren wrote: > On 11.04.19 18:57, Guenter Roeck wrote: >> On Thu, Apr 11, 2019 at 03:30:11PM +0200, Stefan Wahren wrote: >>> >>> -ATTRIBUTE_GROUPS(pwm_fan); >>> +static umode_t pwm_fan_attrs_visible(struct kobject *kobj, struct attribute *a, >>> + int n) >>> +{ >>> + struct device *dev = container_of(kobj, struct device, kobj); >>> + struct pwm_fan_ctx *ctx = dev_get_drvdata(dev); >>> + struct device_attribute *devattr; >>> + >>> + /* Hide fan_input in case no interrupt is available */ >>> + devattr = container_of(a, struct device_attribute, attr); >> Field day for static analyzers - devattr is no longer used. >> No need to resend. I'll let the series rest for a couple of days >> and then apply to hwmon-next (after removing devattr) unless there are >> additional comments. >> > Thank you FWIW you can have a Reviewed-by: Robin Murphy for the whole series. The only minor comment that springs to mind isn't actually specific to this patch, so is probably best made as the follow-up below. Robin. ----->8----- From: Robin Murphy Subject: [PATCH] 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 --- drivers/hwmon/pwm-fan.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c index 8c4c5eefd4ca..556db4bef743 100644 --- a/drivers/hwmon/pwm-fan.c +++ b/drivers/hwmon/pwm-fan.c @@ -330,7 +330,7 @@ static int pwm_fan_probe(struct platform_device *pdev) ret = pwm_apply_state(ctx->pwm, &state); if (ret) { - dev_err(&pdev->dev, "Failed to configure PWM\n"); + dev_err(&pdev->dev, "Failed to configure PWM: %d\n", ret); goto err_reg_disable; } @@ -348,7 +348,8 @@ static int pwm_fan_probe(struct platform_device *pdev) ret = devm_request_irq(&pdev->dev, ctx->irq, pulse_handler, 0, pdev->name, ctx); if (ret) { - dev_err(&pdev->dev, "Can't get interrupt working.\n"); + dev_err(&pdev->dev, + "Failed to request interrupt: %d\n", ret); goto err_pwm_disable; } ctx->sample_start = ktime_get(); @@ -358,8 +359,9 @@ static int pwm_fan_probe(struct platform_device *pdev) hwmon = devm_hwmon_device_register_with_groups(&pdev->dev, "pwmfan", ctx, pwm_fan_groups); if (IS_ERR(hwmon)) { - dev_err(&pdev->dev, "Failed to register hwmon device\n"); ret = PTR_ERR(hwmon); + dev_err(&pdev->dev, + "Failed to register hwmon device: %d\n", ret); goto err_del_timer; } @@ -373,9 +375,10 @@ static int pwm_fan_probe(struct platform_device *pdev) "pwm-fan", ctx, &pwm_fan_cooling_ops); if (IS_ERR(cdev)) { - dev_err(&pdev->dev, - "Failed to register pwm-fan as cooling device"); ret = PTR_ERR(cdev); + dev_err(&pdev->dev, + "Failed to register pwm-fan as cooling device: %d\n", + ret); goto err_del_timer; } ctx->cdev = cdev;