From patchwork Sun Nov 20 17:36:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9438547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6BB2B60235 for ; Sun, 20 Nov 2016 17:36:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4970928904 for ; Sun, 20 Nov 2016 17:36:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29DD2289B3; Sun, 20 Nov 2016 17:36:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AF2228904 for ; Sun, 20 Nov 2016 17:36:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbcKTRgd (ORCPT ); Sun, 20 Nov 2016 12:36:33 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:59002 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751613AbcKTRgc (ORCPT ); Sun, 20 Nov 2016 12:36:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=L1bfI8Ja1cEyS2tlyyfBAcbW+xtaLIwc6mFCngSVhCI=; b=PL6HcbUXur2KD8BYpPNpoeTUo6 nHOO/Dfmk8H2LJvu3Tt8Fo4LF9qwAmrRRtf4vOWjs7bxsVtl4JdjuLeMNzL+2ovpNMN/3HeNdriN6 ayaG+lf4kXXuJYiKHfKEV8CVWQTV7JZwsXBnvB6pcJrZrKIGXy38yB+5HbhCt1KqzgDZ4QRQabJMB NxvIoHexzCZPosPtmQx3hcg5u9TvMYXc3TM6kOV/B8qlbuhLppC1YVd9Ep9W2NieyXMcF15+pFwL0 TPhUmwLOELWI/R3eM/IQgV+ozVN/1NC6/1uzDa4KwP30ErW2cHbhs+m89I8W9pNWXltgiZAQZCdHP ayIHPYgg==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:42448 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1c8W2W-0034Bp-2I; Sun, 20 Nov 2016 17:36:28 +0000 From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 1/7] hwmon: (core) Clarify when read and write callbacks are mandatory Date: Sun, 20 Nov 2016 09:36:22 -0800 Message-Id: <1479663388-2000-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The callback descrption in hwmon.h was misleading and stated that read and write callbacks would be optional. More accurate is is that the callbacks are mandatory if readable / writeable attributes are present. Signed-off-by: Guenter Roeck --- include/linux/hwmon.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 9d2f8bde7d12..b6a86aa4a9e2 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -298,8 +298,7 @@ enum hwmon_pwm_attributes { * Channel number * The function returns the file permissions. * If the return value is 0, no attribute will be created. - * @read: Read callback. Optional. If not provided, attributes - * will not be readable. + * @read: Read callback. Mandatory if readable attributes are present. * Parameters are: * @dev: Pointer to hardware monitoring device * @type: Sensor type @@ -308,8 +307,7 @@ enum hwmon_pwm_attributes { * Channel number * @val: Pointer to returned value * The function returns 0 on success or a negative error number. - * @write: Write callback. Optional. If not provided, attributes - * will not be writable. + * @write: Write callback. Mandatory if writeable attributes are present. * Parameters are: * @dev: Pointer to hardware monitoring device * @type: Sensor type