From patchwork Tue Dec 27 23:28:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9489929 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 70CC7602A7 for ; Tue, 27 Dec 2016 23:28:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53C731FF1E for ; Tue, 27 Dec 2016 23:28:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4853D25E13; Tue, 27 Dec 2016 23:28:46 +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 E929E1FF1E for ; Tue, 27 Dec 2016 23:28:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932931AbcL0X2p (ORCPT ); Tue, 27 Dec 2016 18:28:45 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:55814 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932719AbcL0X2p (ORCPT ); Tue, 27 Dec 2016 18:28:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=yqs9HQgG+y2PBUetmGkDkGObiPI9CR9CWMNw72F7/9Y=; b=i+rMaYqDGXjVr2 AalIIQqk0MTsX8kpkXM311kxpdm/RTu1PVoH+qWfxuG8KTHPnAFi1vC/xJJTpZPedC3Zm7J9gJN6L DmhtYxu1ewv/QkV5A0cZTE5EOTj4HKLAATJ+t/A8QsDl99ucLo1Fshj0/0H68F+xY8xys7wMDpFuC NACqh6nFYT5qjUd4SCkfLLXQyDHmM0Hf8Il4XCb21UbDwHPmFYkiCtBloNc0tbB7BVlI18lvQ5Sc0 55EnyvHw/2LY88FpotiXP0lEBS6haqYR9jCvI5CFnhwHxbly6pxYn6muFzx+D3U8tVeuZQGlks1pS c4VM31gGxBkofz2KPJ3Q==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:51586 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cM1Ai-0044Oi-DT; Tue, 27 Dec 2016 23:28:44 +0000 From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 10/10] hwmon: (adt7411) Replace macro generating sensor attributes Date: Tue, 27 Dec 2016 15:28:28 -0800 Message-Id: <1482881308-13550-11-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482881308-13550-1-git-send-email-linux@roeck-us.net> References: <1482881308-13550-1-git-send-email-linux@roeck-us.net> 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 Replace macro generating sensor attributes with explicit code to ease conversion to SENSOR_DEVICE_ATTR_{RO,RW}. Signed-off-by: Guenter Roeck --- drivers/hwmon/adt7411.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c index b939f8a115ba..bc6e8cd80b68 100644 --- a/drivers/hwmon/adt7411.c +++ b/drivers/hwmon/adt7411.c @@ -199,13 +199,15 @@ static ssize_t adt7411_set_bit(struct device *dev, return ret < 0 ? ret : count; } -#define ADT7411_BIT_ATTR(__name, __reg, __bit) \ - SENSOR_DEVICE_ATTR_2(__name, S_IRUGO | S_IWUSR, adt7411_show_bit, \ - adt7411_set_bit, __bit, __reg) - -static ADT7411_BIT_ATTR(no_average, ADT7411_REG_CFG2, ADT7411_CFG2_DISABLE_AVG); -static ADT7411_BIT_ATTR(fast_sampling, ADT7411_REG_CFG3, ADT7411_CFG3_ADC_CLK_225); -static ADT7411_BIT_ATTR(adc_ref_vdd, ADT7411_REG_CFG3, ADT7411_CFG3_REF_VDD); +static SENSOR_DEVICE_ATTR_2(no_average, S_IRUGO | S_IWUSR, + adt7411_show_bit, adt7411_set_bit, + ADT7411_CFG2_DISABLE_AVG, ADT7411_REG_CFG2); +static SENSOR_DEVICE_ATTR_2(fast_sampling, S_IRUGO | S_IWUSR, + adt7411_show_bit, adt7411_set_bit, + ADT7411_CFG3_ADC_CLK_225, ADT7411_REG_CFG3); +static SENSOR_DEVICE_ATTR_2(adc_ref_vdd, S_IRUGO | S_IWUSR, + adt7411_show_bit, adt7411_set_bit, + ADT7411_CFG3_REF_VDD, ADT7411_REG_CFG3); static struct attribute *adt7411_attrs[] = { &sensor_dev_attr_no_average.dev_attr.attr,