Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2073487rwi; Tue, 1 Nov 2022 03:35:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6bVCJZsKtvVQ/jthoJCUIsokpkLsjymmRIpzPORkUDuNcZjYhKISI708R3uwT344ZBa0TO X-Received: by 2002:a05:6a00:1582:b0:56d:4bc6:68c7 with SMTP id u2-20020a056a00158200b0056d4bc668c7mr12786412pfk.31.1667298952094; Tue, 01 Nov 2022 03:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667298952; cv=none; d=google.com; s=arc-20160816; b=WEqv6u7BZezglf1YsvQXFMmFijyHfWLY8Ug4ieDTptZWWedA3Ue+Nu+ncw9JV+hcmj abKj3HWUoi1p1Q1RCTDWwlhXV5IKvDOCRgpC+D3aiGwnwtJeurrH5iOUK5ulU82hi1Mm I4JIW2Ue2jh7OPu5hrXPb07InDFNWOsVGGzq0IAD6JrKgPT4+l71vvcfMTnt6E2mFvP0 O/OjdYAOQ4wFp3g3bktSLSwUh9S+FZ93nzjf+TBcHwsoHunAl4y6pI9Adv01dq3AkWPS MlLpq4j6fOc6GtFebT56wAhdxu+GRxqz3KIZ8KKt6UniOWOBLCp1gWy/RZeW+hFnSKcC /C/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:cc:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=7jdRsWOVMiSm6C1KUUqFfvY28MnHbWxFB6mlIORcMGU=; b=x36fkTqDd3XoKlzELjjRmosAoeiyrZ+IYoe4ly/6YQIq5p6eilZgVDOGkMhcVZtMiO nCywkovI0gPrXZG0HXZU4Oaw8uf/G1bKYv1GPXtd/a8D/3BMrWiJQoiwSjxQHrzBa2lT QoHEZ2wqkEyvwzMZz44bUIJvoCFTC8GZDlcc0hX+tBJdbuWtiPc7ElkRndxrlh37EPEU SxH9p0sIyj3Lz/kgTb1UYtWRH5dbsfJMa1hIxWSx11O2y2C1r007/BjzFE/i2m6A6/u+ DTuF9kosadiMooTraytho+UDzafdLFeSWtKVWc9In7jPogtX0EcDiBC771rMuejwXnxe MQpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a170902740800b00186971db5fbsi10862990pll.220.2022.11.01.03.35.36; Tue, 01 Nov 2022 03:35:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbiKAKQ6 (ORCPT + 97 others); Tue, 1 Nov 2022 06:16:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbiKAKQ4 (ORCPT ); Tue, 1 Nov 2022 06:16:56 -0400 Received: from smtp.smtpout.orange.fr (smtp-21.smtpout.orange.fr [80.12.242.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F225F18349 for ; Tue, 1 Nov 2022 03:16:54 -0700 (PDT) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id poK5o6hO9TyoupoK5oU5C1; Tue, 01 Nov 2022 11:16:53 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 11:16:53 +0100 X-ME-IP: 86.243.100.34 Message-ID: <4e7beec4-9b77-a125-6715-2699c453f5fe@wanadoo.fr> Date: Tue, 1 Nov 2022 11:16:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [v2 3/3] hwmon: Add Aspeed ast2600 TACH support Content-Language: fr To: Billy Tsai References: <20221101095156.30591-1-billy_tsai@aspeedtech.com> <20221101095156.30591-4-billy_tsai@aspeedtech.com> From: Christophe JAILLET Cc: jdelvare@suse.com, linux@roeck-us.net, robh+dt@kernel.org, joel@jms.id.au, andrew@aj.id.au, lee.jones@linaro.org, thierry.reding@gmail.com, u.kleine-koenig@pengutronix.de, p.zabel@pengutronix.de, linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, BMC-SW@aspeedtech.com, garnermic@meta.com In-Reply-To: <20221101095156.30591-4-billy_tsai@aspeedtech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 01/11/2022 à 10:51, Billy Tsai a écrit : > This patch add the support of Tachometer which can use to monitor the > frequency of the input. The tach supports up to 16 channels and it's part > function of multi-function device "pwm-tach controller". > > Signed-off-by: Billy Tsai Hi, a few nits below, [...] > + > + if (ret) { > + /* return 0 if we didn't get an answer because of timeout*/ Missing space at the end of the comment > + if (ret == -ETIMEDOUT) > + return 0; > + else > + return ret; [...] > +static int aspeed_tach_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct device_node *np, *child; > + struct aspeed_tach_data *priv; > + struct device *hwmon; > + struct platform_device *parent_dev; > + int ret; > + > + np = dev->parent->of_node; > + if (!of_device_is_compatible(np, "aspeed,ast2600-pwm-tach")) > + return dev_err_probe(dev, -ENODEV, > + "Unsupported tach device binding\n"); > + > + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); > + if (!priv) > + return -ENOMEM; > + priv->dev = &pdev->dev; > + priv->tach_channel = > + devm_kzalloc(dev, > + TACH_ASPEED_NR_TACHS * sizeof(*priv->tach_channel), > + GFP_KERNEL); use devm_kcalloc() instead of devm_kzalloc()? Error handling? > + > + priv->regmap = syscon_node_to_regmap(np); > + if (IS_ERR(priv->regmap)) { > + dev_err(priv->dev, "Couldn't get regmap\n"); In order to be conistent with the other error handling paths: return dev_err_probe()? > + return -ENODEV; > + } [...]