From patchwork Tue Apr 3 09:49:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 132706 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3586171ljb; Tue, 3 Apr 2018 02:49:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+tetTRO9n9/taN+pGhxoU5yB0DqfwXXzTm5uK5BZxARCwLMyY9oV24JL/jD2bD0IvIad+M X-Received: by 2002:a17:902:6184:: with SMTP id u4-v6mr13747104plj.390.1522748955204; Tue, 03 Apr 2018 02:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522748955; cv=none; d=google.com; s=arc-20160816; b=jhnfhlgtnUuKg92NJBVOkIqGHMPE8ew+olyd8uhrQFgQSXAnUVjqo2+ycjlBqK3NYT RhLh/zby4EWMrbSfrk70h7Tekb/OTB3+8QM8k74hPAG8yCJ31DAgDOAk9u/GQM65iGWj jg6880N8b0ncbtYFgMQsgmvRj4ZFjR14HqX9AZU7MklUYXXqYUdqwh7od+BSh4qqT8IH fjMCSmDL4Y3aOEHFcESPSELDA3VkfLHXLeIvtOwHYhY/7XfDiWFj/FSsl3hsINKphHFE /75AQUh20c2/Ehr4hxozgeALPOrsg/L92jNXVVKB/lGadqormACPzgu6ruxiilMbKrVb BSWg== 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=71D7VE1Y0zgwP1JTzNpD4jsJzzeFtf0pYGX8G1iFXHg=; b=VGZDSFwMgpzqXR0YCT5xGVO4hiTYVFRaemiacu+n4u8SoiKZGGynU9x8csCEdQ49Sg gesCUtvmq67F1fw4ekBuFhLfOgWg7EQ1F563HHJ5kUdYz+yTF32NhTnWS5vYH8bCfpdf QTsdAj0UL9ufoyAYlryT4kAZVf09/tGFiFHJnH7Z+3xO22K0E0pTR00hI1Not0RBggxj 6zwys8pEzRSwxuuORNCBPk1EAd5mJ9RexMIfFSSMeGVhmrj2wD6OlATjti2nl+mdibKJ mgzfJRNNs6tRcwVK4TXunym+Kmn6MPh38ynPt1D4CMWPh9RhDrgAUPrpXjQkqaKVfHXo YGwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K+eQ7vov; 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.14; Tue, 03 Apr 2018 02:49:15 -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=K+eQ7vov; 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 S1754355AbeDCJtO (ORCPT + 11 others); Tue, 3 Apr 2018 05:49:14 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:38352 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbeDCJtN (ORCPT ); Tue, 3 Apr 2018 05:49:13 -0400 Received: by mail-pl0-f66.google.com with SMTP id k6-v6so2970802pls.5 for ; Tue, 03 Apr 2018 02:49:13 -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=71D7VE1Y0zgwP1JTzNpD4jsJzzeFtf0pYGX8G1iFXHg=; b=K+eQ7vov8ryA/tMo/SFsX9HK8AxPhHwh4kryyVRqUc8EdeETwqTi/7qzjX6bebUMsK i4CkjujOtJqts3whzVzi99K8/+zpIljqqWoI1LgXSarqeVBVwkJuW0MRhXAbLuXPqEYV 9fbGFwhzsS1rtEssielIqeSqCMmQWVKb7PbxQ= 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=71D7VE1Y0zgwP1JTzNpD4jsJzzeFtf0pYGX8G1iFXHg=; b=sNIlZ3/SdorHUVgu7co2ZExYJchE+v6HSp8e+phqMN9exanGgtPD6EquPUniID5oCZ WeyRxdJYpag/rHpSgTfDPmsC75qqSpXFc7AHhQA6UHONfDe4e6xsf8Id2GJwZKg1OrMx C/zmvkK3I5r3NacQSBQkNqBTu7nNs+1y/Q25uXNVH71Cu0dUVxWd/8lZwpkXA/HaW7SD 2TCi7pIdmfxOCxXmRig8+buIQGTKGSvHDYg3fMD2QD+J6lIq5x/qnhF0t9+afvBXKi8f i4GXdLzyWrZhA9MQMSwqJI9/RMkEyFDWYt88UiM5uoDW/z6DfEYoh+T1CJVQIgxiz1Zt goMA== X-Gm-Message-State: AElRT7GyJg9V++WE4jB7l1Pe0AuPza8iiOJTiUpS8Hc0rL+dxRRx7Fsx 8xOTyE234WJFsshjeWlPolpPyONkN4Q= X-Received: by 10.99.127.92 with SMTP id p28mr8792360pgn.305.1522748953023; Tue, 03 Apr 2018 02:49:13 -0700 (PDT) Received: from localhost ([122.171.228.188]) by smtp.gmail.com with ESMTPSA id 5sm5443613pfh.133.2018.04.03.02.49.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 02:49:12 -0700 (PDT) From: Viresh Kumar To: Zhang Rui , Eduardo Valentin Cc: Viresh Kumar , Vincent Guittot , linux-pm@vger.kernel.org Subject: [PATCH 1/2] thermal: Shorten name of sysfs callbacks Date: Tue, 3 Apr 2018 15:19:03 +0530 Message-Id: <6ff16be439d88dc5392c8c0c88ac5931724d970c.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 The naming isn't consistent across all sysfs callbacks in the thermal core, some have a short name like type_show() and others have long names like thermal_cooling_device_weight_show(). This patch tries to make it consistent by shortening the name of sysfs callbacks. Some of the sysfs files are named similarly for both thermal zone and cooling device (like: type) and to avoid name clash between their show/store routines, the cooling device specific sysfs callbacks are prefixed with "cdev_". Signed-off-by: Viresh Kumar --- drivers/thermal/thermal_core.c | 6 ++-- drivers/thermal/thermal_core.h | 13 +++----- drivers/thermal/thermal_sysfs.c | 74 +++++++++++++++-------------------------- 3 files changed, 34 insertions(+), 59 deletions(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index d64325e078db..649fd2a04823 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -736,7 +736,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, sysfs_attr_init(&dev->attr.attr); dev->attr.attr.name = dev->attr_name; dev->attr.attr.mode = 0444; - dev->attr.show = thermal_cooling_device_trip_point_show; + dev->attr.show = trip_point_show; result = device_create_file(&tz->device, &dev->attr); if (result) goto remove_symbol_link; @@ -745,8 +745,8 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, sysfs_attr_init(&dev->weight_attr.attr); dev->weight_attr.attr.name = dev->weight_attr_name; dev->weight_attr.attr.mode = S_IWUSR | S_IRUGO; - dev->weight_attr.show = thermal_cooling_device_weight_show; - dev->weight_attr.store = thermal_cooling_device_weight_store; + dev->weight_attr.show = weight_show; + dev->weight_attr.store = weight_store; result = device_create_file(&tz->device, &dev->weight_attr); if (result) goto remove_trip_file; diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 5e4150261500..eddee27c1d06 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -75,15 +75,10 @@ void thermal_zone_destroy_device_groups(struct thermal_zone_device *); void thermal_cooling_device_setup_sysfs(struct thermal_cooling_device *); void thermal_cooling_device_destroy_sysfs(struct thermal_cooling_device *cdev); /* used only at binding time */ -ssize_t -thermal_cooling_device_trip_point_show(struct device *, - struct device_attribute *, char *); -ssize_t thermal_cooling_device_weight_show(struct device *, - struct device_attribute *, char *); - -ssize_t thermal_cooling_device_weight_store(struct device *, - struct device_attribute *, - const char *, size_t); +ssize_t trip_point_show(struct device *, struct device_attribute *, char *); +ssize_t weight_show(struct device *, struct device_attribute *, char *); +ssize_t weight_store(struct device *, struct device_attribute *, const char *, + size_t); #ifdef CONFIG_THERMAL_STATISTICS void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev, diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 23b5e0a709b0..ba1df6953da6 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -668,17 +668,15 @@ void thermal_zone_destroy_device_groups(struct thermal_zone_device *tz) /* sys I/F for cooling device */ static ssize_t -thermal_cooling_device_type_show(struct device *dev, - struct device_attribute *attr, char *buf) +cdev_type_show(struct device *dev, struct device_attribute *attr, char *buf) { struct thermal_cooling_device *cdev = to_cooling_device(dev); return sprintf(buf, "%s\n", cdev->type); } -static ssize_t -thermal_cooling_device_max_state_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t max_state_show(struct device *dev, struct device_attribute *attr, + char *buf) { struct thermal_cooling_device *cdev = to_cooling_device(dev); unsigned long state; @@ -690,9 +688,8 @@ thermal_cooling_device_max_state_show(struct device *dev, return sprintf(buf, "%ld\n", state); } -static ssize_t -thermal_cooling_device_cur_state_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t cur_state_show(struct device *dev, struct device_attribute *attr, + char *buf) { struct thermal_cooling_device *cdev = to_cooling_device(dev); unsigned long state; @@ -705,9 +702,8 @@ thermal_cooling_device_cur_state_show(struct device *dev, } static ssize_t -thermal_cooling_device_cur_state_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +cur_state_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) { struct thermal_cooling_device *cdev = to_cooling_device(dev); unsigned long state; @@ -726,13 +722,10 @@ thermal_cooling_device_cur_state_store(struct device *dev, return count; } -static struct device_attribute dev_attr_cdev_type = -__ATTR(type, 0444, thermal_cooling_device_type_show, NULL); -static DEVICE_ATTR(max_state, 0444, - thermal_cooling_device_max_state_show, NULL); -static DEVICE_ATTR(cur_state, 0644, - thermal_cooling_device_cur_state_show, - thermal_cooling_device_cur_state_store); +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 struct attribute *cooling_device_attrs[] = { &dev_attr_cdev_type.attr, @@ -791,10 +784,8 @@ void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev, spin_unlock(&stats->lock); } -static ssize_t -thermal_cooling_device_total_trans_show(struct device *dev, - struct device_attribute *attr, - char *buf) +static ssize_t total_trans_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct thermal_cooling_device *cdev = to_cooling_device(dev); struct cooling_dev_stats *stats = cdev->stats; @@ -808,9 +799,8 @@ thermal_cooling_device_total_trans_show(struct device *dev, } static ssize_t -thermal_cooling_device_time_in_state_show(struct device *dev, - struct device_attribute *attr, - char *buf) +time_in_state_ms_show(struct device *dev, struct device_attribute *attr, + char *buf) { struct thermal_cooling_device *cdev = to_cooling_device(dev); struct cooling_dev_stats *stats = cdev->stats; @@ -830,9 +820,8 @@ thermal_cooling_device_time_in_state_show(struct device *dev, } static ssize_t -thermal_cooling_device_reset_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +reset_store(struct device *dev, struct device_attribute *attr, const char *buf, + size_t count) { struct thermal_cooling_device *cdev = to_cooling_device(dev); struct cooling_dev_stats *stats = cdev->stats; @@ -853,10 +842,8 @@ thermal_cooling_device_reset_store(struct device *dev, return count; } -static ssize_t -thermal_cooling_device_trans_table_show(struct device *dev, - struct device_attribute *attr, - char *buf) +static ssize_t trans_table_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct thermal_cooling_device *cdev = to_cooling_device(dev); struct cooling_dev_stats *stats = cdev->stats; @@ -899,13 +886,10 @@ thermal_cooling_device_trans_table_show(struct device *dev, return len; } -static DEVICE_ATTR(total_trans, 0444, thermal_cooling_device_total_trans_show, - NULL); -static DEVICE_ATTR(time_in_state_ms, 0444, - thermal_cooling_device_time_in_state_show, NULL); -static DEVICE_ATTR(reset, 0200, NULL, thermal_cooling_device_reset_store); -static DEVICE_ATTR(trans_table, 0444, - thermal_cooling_device_trans_table_show, NULL); +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 struct attribute *cooling_device_stats_attrs[] = { &dev_attr_total_trans.attr, @@ -980,8 +964,7 @@ void thermal_cooling_device_destroy_sysfs(struct thermal_cooling_device *cdev) /* these helper will be used only at the time of bindig */ ssize_t -thermal_cooling_device_trip_point_show(struct device *dev, - struct device_attribute *attr, char *buf) +trip_point_show(struct device *dev, struct device_attribute *attr, char *buf) { struct thermal_instance *instance; @@ -995,8 +978,7 @@ thermal_cooling_device_trip_point_show(struct device *dev, } ssize_t -thermal_cooling_device_weight_show(struct device *dev, - struct device_attribute *attr, char *buf) +weight_show(struct device *dev, struct device_attribute *attr, char *buf) { struct thermal_instance *instance; @@ -1005,10 +987,8 @@ thermal_cooling_device_weight_show(struct device *dev, return sprintf(buf, "%d\n", instance->weight); } -ssize_t -thermal_cooling_device_weight_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +ssize_t weight_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) { struct thermal_instance *instance; int ret, weight; 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,