Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2218457rdb; Sun, 3 Dec 2023 07:26:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0Yb/8UM4fDZ4k0betodfW6cU/u0tkVYYQke9d/WNptsbVJqjqNh73FXNjpsgvNnkm9EPx X-Received: by 2002:a17:90a:f412:b0:286:6cc0:884e with SMTP id ch18-20020a17090af41200b002866cc0884emr744861pjb.59.1701617185054; Sun, 03 Dec 2023 07:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701617185; cv=none; d=google.com; s=arc-20160816; b=jdbkhsg7sOdwcrPtUjFLgV7URjPy8dnvtwXS0niscpNiXecpg2RYzc7LVEgs2Zu9nS en5ExSCBqpGfxvf0doCUnxTrMPlg9nhGGTpPMwWOk8wFfvYVTRx1Juho2aHqHjzzVvJN Cn2I7/juI2M+rnjdIu/c9P8dBOtlaUIfjBnyITDVbc4ZcvkJQk0z7cxQVxPBLFlNDhsJ +DieFv8lQ0ZW1u4SwNV9hRj+nyzX0bN9ZlyM7fA8hhrRwxUsJ3nk1JgR79rz3tFlRH7l SC1inQPBv+jtJtbOpxVpV4zwej3taVHk7E5B+BMYhmxSoQdL8aVK4DfVAPX97/c67VAy 4eVQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=z4+LCeotKhKAPKowkUt28WTuHMog6jIptBmCHVjylLU=; fh=lnP76NRN75u84G4tRvOzUxiaLQrMVJd36iPvw92hZwE=; b=HMbAVRCzj6o6DokNc3DsfsQBV//uuUCIETSwmDbWdcNNAReoUpiIQnsQJ5Y0ZUjWv/ vd7lpFE38/Mu4mSwrVtWWQr49c5nHBUuBv0hbeyVp4swHEByyde6gFQOmv1NCJPv6yJp +dibK3q8tTPzlYpLjy/t40uaB8HbjmdsXT/qIWKlFzVdJPt/VgUa0FdgoVDf87unagUg GQtigNFWtfYOZg2Zrp7h0Fuj1xKvWKi79Tq5fcldZJRUvvMeNTYPn89eQq0aNH0zuH1A 9+Is/quv61C2jrb6AAwt9Hq6cojw3v4cvIWJObzWXtbZ+xuZg9fxdKgSXZ+uKGPoJyQ9 YIlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=JENUHg+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id gj22-20020a17090b109600b002869e1309fdsi739290pjb.132.2023.12.03.07.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 07:26:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=JENUHg+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 77ED3804B399; Sun, 3 Dec 2023 07:26:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233622AbjLCP0B (ORCPT + 99 others); Sun, 3 Dec 2023 10:26:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjLCP0A (ORCPT ); Sun, 3 Dec 2023 10:26:00 -0500 Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39AE3EB for ; Sun, 3 Dec 2023 07:26:07 -0800 (PST) Received: from [192.168.1.18] ([92.140.202.140]) by smtp.orange.fr with ESMTPA id 9oM6rdpxsFU7r9oM6rRcHp; Sun, 03 Dec 2023 16:26:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1701617165; bh=z4+LCeotKhKAPKowkUt28WTuHMog6jIptBmCHVjylLU=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=JENUHg+xMkY+68I+254ksHx8nw21VSEVU1B0VBuPg/havST9ddSIRBFhEOmAnT0tP v1exUHShDMFAaoIqqE5cJSfoPcfF6c2nq4ClwUMX7vaagnZMDlNvePRKdfBhDFhxyC rhibZGktwky3IMxcvUA3JO6whBWp+IWABlFv8FKoTB3YiroSqgYv4AmI4s+JLsJ8Mq A3z4skBbzbdUlyBm0EOPOny3z7bZn/AjsjYTw11hZHHm2bSjZJpeO/4TXwQh8M5KY/ 3uCoVDQpGvQ0YtZR7NXJQulULRC/WSE+wuD5Z9AgLyWN8Kx8GSXGTbzGXeL84HRKP3 cEy0FvIlvN7+Q== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 03 Dec 2023 16:26:05 +0100 X-ME-IP: 92.140.202.140 Message-ID: <5404194d-9ee6-4def-a040-f5858d8c2d66@wanadoo.fr> Date: Sun, 3 Dec 2023 16:26:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] hwmon: Add driver for Gigabyte AORUS Waterforce AIO coolers Content-Language: fr To: Aleksa Savic , linux-hwmon@vger.kernel.org Cc: Jean Delvare , Guenter Roeck , Jonathan Corbet , "open list:DOCUMENTATION" , open list References: <20231203120651.371429-1-savicaleksa83@gmail.com> <2a89f0b4-990a-4d0d-8e54-c4215579c23c@wanadoo.fr> <121470f0-6c1f-418a-844c-7ec2e8a54b8e@gmail.com> From: Christophe JAILLET In-Reply-To: <121470f0-6c1f-418a-844c-7ec2e8a54b8e@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 03 Dec 2023 07:26:22 -0800 (PST) Le 03/12/2023 à 16:00, Aleksa Savic a écrit : >>> +static int waterforce_probe(struct hid_device *hdev, const struct hid_device_id *id) >>> +{ >>> +    struct waterforce_data *priv; >>> +    int ret; >>> + >>> +    priv = devm_kzalloc(&hdev->dev, sizeof(*priv), GFP_KERNEL); >>> +    if (!priv) >>> +        return -ENOMEM; >>> + >>> +    priv->hdev = hdev; >>> +    hid_set_drvdata(hdev, priv); >>> + >>> +    /* >>> +     * Initialize priv->updated to STATUS_VALIDITY seconds in the past, making >>> +     * the initial empty data invalid for waterforce_read() without the need for >>> +     * a special case there. >>> +     */ >>> +    priv->updated = jiffies - msecs_to_jiffies(STATUS_VALIDITY); >>> + >>> +    ret = hid_parse(hdev); >>> +    if (ret) { >>> +        hid_err(hdev, "hid parse failed with %d\n", ret); >>> +        return ret; >>> +    } >>> + >>> +    /* >>> +     * Enable hidraw so existing user-space tools can continue to work. >>> +     */ >>> +    ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); >>> +    if (ret) { >>> +        hid_err(hdev, "hid hw start failed with %d\n", ret); >>> +        goto fail_and_stop; >> >> Should this be 'return ret;' (the _start has failed, so why stop?) > > Hm, yes. > >> >>> +    } >>> + >>> +    ret = hid_hw_open(hdev); >>> +    if (ret) { >>> +        hid_err(hdev, "hid hw open failed with %d\n", ret); >>> +        goto fail_and_close; >> >> Should this be 'fail_and_stop' (the _open has failed, so why close?) > > Also yes... I based this part on the nzxt-kraken2 driver in the tree, > perhaps that should be investigated as well. The aquacomputer_d5next driver > seems to be doing it correctly. Done, patch sent. CH