From patchwork Tue Apr 3 09:49:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 132707 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3586222ljb; Tue, 3 Apr 2018 02:49:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx49lmG8TSzMik4JHP8g0YWrXk8ttjufi6ATG3PAgY54g91aNap/EgBm+dQalCV5v7+VnuV9o X-Received: by 10.98.163.153 with SMTP id q25mr10100865pfl.189.1522748957766; Tue, 03 Apr 2018 02:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522748957; cv=none; d=google.com; s=arc-20160816; b=0+hwWa2IjcKwxW4rCjhGmR/g8QI2BHBogtE+kyoiXjrISf72MzFMl/CC/KGSEqqDl1 0e1DuqUh1WWW4xQZrSl9rHS8ZmpZnwbil7qqiCJ/I7YpefQZbqI+nOPCMM6jfKR3nzDE djJSR5d3/u+lusez4a1Fai3wCzUHBFkZq+EoUPWjpFqpg52fwgFcAn2OVSX3zo6mkfyb XYqNocM/vuZMzhnZpyVxW/Tx/3VlclXiAP4PmpjM1K2vSkLylYUNFgG61Kb59EC/YKh2 7J3QJ2idlSq5aaj2h0bbhtbR8WNhMiAVUguwrr0BDa3c6MVSKWzXJfj6iq43N7a+71yv 9kJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=wkWfej4lXBA41niNgdIpjLxSp80Mzo42OXJ9xvToj4c=; b=TGB62agjLblT+sD0Ig6RwvRTdqxErJp9oPCZMMkEW4KaaRjthd4bqSA7Hh/HOOm3iP i4OA1+J9IhyETwmUvHRnN+zvlu6z0KuLJ5scoSSX6u7tdykEXbw/8BrcKZ4U6T7RnLl+ FWf/DdN287VrR6DfnqmWM7Jia5ev4iZqGxBOsdf1YU0+QetAPN4vc8h3Qxqg2pFi56vV BNaXjmwH4fk2n3vKNS3cugs7J3MqccPeW0Bo83SXKFLTMSWsfd0osnTMIsmbyeRic83X btAclb2KAWIcgfDfwsUUQzU529s3oG53jz83CAMAikA/bpLNVDBib6Rm+aYfDlZh8Wku x5Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X45IsXNg; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si1670219pgq.625.2018.04.03.02.49.17; Tue, 03 Apr 2018 02:49:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X45IsXNg; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754858AbeDCJtQ (ORCPT + 11 others); Tue, 3 Apr 2018 05:49:16 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:42193 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754822AbeDCJtQ (ORCPT ); Tue, 3 Apr 2018 05:49:16 -0400 Received: by mail-pl0-f66.google.com with SMTP id g20-v6so8074942plo.9 for ; Tue, 03 Apr 2018 02:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=wkWfej4lXBA41niNgdIpjLxSp80Mzo42OXJ9xvToj4c=; b=X45IsXNgqv22BdzHRr2opk6IUe+9hvxMfAT6UQBYwaQlwfvuGpWKoSWfl98BBiUGXl aUZJi1zQ6cuQ8vZgQ130Hb1wE4S44Kahog5tiyHnb4/di7Hst+GscJhuGxCHQY8zVFeX ZdiK1OWGrzNvj59j8noLNubPitgZucohN0xFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=wkWfej4lXBA41niNgdIpjLxSp80Mzo42OXJ9xvToj4c=; b=S+3ggmwEjQV1LSuEIuv3AJkeVQy7aWMMnR9DMNfDDpVrum3RuzTzfUgmAE8r6A3upm G4pyZa1Yy17UYSr8e2hVa2zd36edV5wZiz9ANGJqA9Vpva88RCovYm/u/HTP6qCpZ2z7 D1OF8ajEYy7YGqRQ/ilBmRBiLAIoyOBW2khWTsDj0Sesznl6719FnWHDCcEK89jnZm+z lH55XgL5JYktk96Iop+JxdJ3YO5BR4ni1ZjjsuQAYg1du7jxvpxp/R7i41RA9w6+jzQf PpL3FLHSwp8rfsEmB/bM5tnOgoa13fcid6LleKy+36uzUavkRSCLD/5+71nVblV0iNU8 X8YQ== X-Gm-Message-State: AElRT7Hi/3qeSJgMwU8O/K4CUIAowRHtZsLgmDqYwFsn2Y2XbQ63r7ev qKNQi56KKY58w72thXrXeCgjbg== X-Received: by 2002:a17:902:aa48:: with SMTP id c8-v6mr13058102plr.361.1522748955701; Tue, 03 Apr 2018 02:49:15 -0700 (PDT) Received: from localhost ([122.171.228.188]) by smtp.gmail.com with ESMTPSA id t15sm1921327pfh.76.2018.04.03.02.49.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 02:49:15 -0700 (PDT) From: Viresh Kumar To: Zhang Rui , Eduardo Valentin Cc: Viresh Kumar , Vincent Guittot , linux-pm@vger.kernel.org Subject: [PATCH 2/2] thermal: Use DEVICE_ATTR_{RO|RW|WO}() variants Date: Tue, 3 Apr 2018 15:19:04 +0530 Message-Id: <2f7b2301539a428d23ee5e9d7cf11e86c60470cc.1522748815.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Use the DEVICE_ATTR_{RO|RW|WO}() variants instead of DEVICE_ATTR(). Signed-off-by: Viresh Kumar --- drivers/thermal/thermal_sysfs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index ba1df6953da6..721726565fef 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -381,7 +381,7 @@ sustainable_power_store(struct device *dev, struct device_attribute *devattr, \ return count; \ } \ - static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, name##_show, name##_store) + static DEVICE_ATTR_RW(name) create_s32_tzp_attr(k_po); create_s32_tzp_attr(k_pu); @@ -724,8 +724,8 @@ cur_state_store(struct device *dev, struct device_attribute *attr, static struct device_attribute dev_attr_cdev_type = __ATTR(type, 0444, cdev_type_show, NULL); -static DEVICE_ATTR(max_state, 0444, max_state_show, NULL); -static DEVICE_ATTR(cur_state, 0644, cur_state_show, cur_state_store); +static DEVICE_ATTR_RO(max_state); +static DEVICE_ATTR_RW(cur_state); static struct attribute *cooling_device_attrs[] = { &dev_attr_cdev_type.attr, @@ -886,10 +886,10 @@ static ssize_t trans_table_show(struct device *dev, return len; } -static DEVICE_ATTR(total_trans, 0444, total_trans_show, NULL); -static DEVICE_ATTR(time_in_state_ms, 0444, time_in_state_ms_show, NULL); -static DEVICE_ATTR(reset, 0200, NULL, reset_store); -static DEVICE_ATTR(trans_table, 0444, trans_table_show, NULL); +static DEVICE_ATTR_RO(total_trans); +static DEVICE_ATTR_RO(time_in_state_ms); +static DEVICE_ATTR_WO(reset); +static DEVICE_ATTR_RO(trans_table); static struct attribute *cooling_device_stats_attrs[] = { &dev_attr_total_trans.attr,