Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp484247yba; Fri, 12 Apr 2019 07:30:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqygcD9Rzy/eMdljl1YOwrR6OoUFr7zo3dbdXe8xf33xCA/nElPZr1s+mRjEj7FoXECRTRwZ X-Received: by 2002:a62:e710:: with SMTP id s16mr49114717pfh.74.1555079406038; Fri, 12 Apr 2019 07:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555079406; cv=none; d=google.com; s=arc-20160816; b=trYga5dR3wmqkLtJlp4ZUOsQ8SBpanRvAmaD4TYJQpRQUc75TEi0blwOnnmF5sMGrp hv2XjaN2JYT+ssVjT6RIWci7007rL5D65xp2Ltp32XAcjfeCm1A8p6dDtCcrRy1n4rc3 oGjonTeD/G2QKeOMTog8UOWjXyUSQtPkKw2a43Z3RYFmPCImpXXJK/mpZVJTWreJ5zIO BYxK01IMjxaPC95UzYdem2cEToqoMxOBiw8Gk+dBkradywH3aqYl2TvWhUKL75V2LfZ1 +cs58KgpK/BmXo9ZZ5bXCMq2KJvBA3JxqR2cK+BAM8T93sdeGdaMMkReQDCeB/X02c/s iEdw== 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:from:references:cc:to:subject:dkim-signature; bh=vASg5JkI2W0DXNvLU0zD/DEqrNgshrSx1kIECTH27ws=; b=puJby9hCAjlpzVjsmjqb2tjF9kTVwlB1s68lQL3yIDNtNM8hjYtPYOJLCtEqyqfPfv JHyLnuFAL6to0P8nkwQ6UoePSiFsELOdYGxhjz6JCUDtGV6PHJPfSrPWg9b9+wsfa7tS ZaAUqxEGK0nr0Nrw92qSPlputgMBMooLQ1tADtjZfPNcEnrHZo9lnPjaiKkqyxYmBjRd 2mnlgHhp7VUlB8MuhiqkkYvP0caRREUXCnqstnXFqHzl8QFFoFuyYAC7zc/2nua80T2z SpbkRTiZXVTXIlStk09zN1PTLYxJKaCKjb3dlo6Jtw8x5LAwMXRcPAofdfBjumcgRVNQ gMTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="UNn/sMRW"; 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 y8si28610468plt.119.2019.04.12.07.29.49; Fri, 12 Apr 2019 07:30:06 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b="UNn/sMRW"; 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 S1727129AbfDLO3K (ORCPT + 99 others); Fri, 12 Apr 2019 10:29:10 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37655 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726965AbfDLO3J (ORCPT ); Fri, 12 Apr 2019 10:29:09 -0400 Received: by mail-pl1-f195.google.com with SMTP id w23so5226913ply.4; Fri, 12 Apr 2019 07:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vASg5JkI2W0DXNvLU0zD/DEqrNgshrSx1kIECTH27ws=; b=UNn/sMRWO1iRzHVK73BK17JVxmNrwNvvklz3obwUfUxNmXav8kD0ePMAVNvTMu55na Qlt2z1ayDwKQWlQ7LA4AqStY2KCVR5Iabj6MBBgR/PSzrjCswX886ACNRGxfbnfRo/7L lD41/gnVqw0iFRN4DOkNfW2TR7nfawlpaze1sbv/hhwp/nv6qGZ6ku1TXxa6YehV5Kej /RTNaiCJvN0PWthUG/92qEkV0nE6mrTrm6SV2CaO/7cYuEtuQTzazBlcGlOd3jKTkYCa lOW5MG/gPfmwEQ9vYYEuPFOPsPgStULIExGvYXSBOObxg3YGeOTyZuU+A10GNZ7uHcAi 5OTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vASg5JkI2W0DXNvLU0zD/DEqrNgshrSx1kIECTH27ws=; b=ZBFw0u7+lKkSgyvk2xLi2/mqcA1lYlDDXse2wx+MtGfcrczangsTstVyqYHGQCvEeG /in94aLHIUzK4LKhzXeaytVrPxRFF9lSQ0dCc0syAiCOVURlAwygVisEl6+nMbKU4Ww7 xG9l9QZ5s4+Hf9AVD/7RU0DBFx62JzuAyfpSFf63la7fI3J2uo5TvfrSpE3zMiRjnXbX M3sHl1jp9Ien20zImyr/qvA4lhXlw5751UYEEGoqsGY/MuYurXwdrpC4KWJ96T1LaJKF 2pCqGoLsdE3iAJCEpGEpzQDKdOtMAjTzqgpVJVi9KIDgoeXDJeByXYMrDv0pz5MguiF0 DbYQ== X-Gm-Message-State: APjAAAXYAPBvCK2nBOFZ5v/ZU9q9Sb74tk5c/u+Hok12RcZ0gU8luczB fvMvY3lEJz+NpbtiNx9fb3/3hioJ X-Received: by 2002:a17:902:d83:: with SMTP id 3mr33457160plv.125.1555079348555; Fri, 12 Apr 2019 07:29:08 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id k14sm90412480pfb.125.2019.04.12.07.29.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 07:29:06 -0700 (PDT) Subject: Re: [PATCH V5 3/3] hwmon: pwm-fan: Add RPM support via external interrupt To: Robin Murphy , Stefan Wahren 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> <77c56129-d3e7-1518-9d1d-a15a20540269@arm.com> <19616839-f78f-a15f-c7b7-7ef9e7817140@arm.com> From: Guenter Roeck Message-ID: Date: Fri, 12 Apr 2019 07:29:04 -0700 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: <19616839-f78f-a15f-c7b7-7ef9e7817140@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/12/19 6:54 AM, Robin Murphy wrote: > On 12/04/2019 14:50, Guenter Roeck wrote: >> On 4/12/19 4:50 AM, Robin Murphy wrote: >>> 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. >>> >> >> Any chance you can send the patch below as separate patch ? I track patches >> using patchwork, and attachments don't show up there. > > Sure, can do - would you like an explicit R-b on #1 and #2 here for patchwork to pick up as well? > That would simplify my life a bit, but I can add that part myself to the patches. I primarily like to have the patches in patchwork to make sure they don't get lost and that I can pick them up again later if needed. Thanks, Guenter > Robin. > >> >> Thanks, >> Guenter >> >>> ----->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; >>> >> >