From patchwork Thu May 31 14:01:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Germann X-Patchwork-Id: 10441165 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 5DF6B603D7 for ; Thu, 31 May 2018 14:03:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FF9C296E9 for ; Thu, 31 May 2018 14:03:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B70B29713; Thu, 31 May 2018 14:03:10 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable 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 C1C1F2982A for ; Thu, 31 May 2018 14:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755202AbeEaOBy (ORCPT ); Thu, 31 May 2018 10:01:54 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:38793 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755103AbeEaOBv (ORCPT ); Thu, 31 May 2018 10:01:51 -0400 Received: by mail-wr0-f193.google.com with SMTP id 94-v6so33110503wrf.5 for ; Thu, 31 May 2018 07:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fishpost-de.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y/ODGq4bxRX+7vRH9EfRNHPQ79as4a6DGbu+P98atT8=; b=1/mqhCZE625A0gU+ujLVxcvNwDJ5RVanHoe1vlTFHAR0BXljvrqhKxv062rgTCa3Hx lPVjoR/3BztpVXd6MyB1zIVU2fV3NslM/HOvKQs3LC7lhcPFtyvskoyZjg3Yb7+JfX5D v2OaqBjg7So9vkJN3ll3RXzyc3LVd4m4qZix5EgkMp4C2SznBEoy3qAQdElXPF6kyobb rTjax2NnkTGejXVnKCy+n1Wws/6/CwLdMZ8NxhTPvLBr5H+Mquu+mKk5IVXC/eDPxBQO nP/or1ipm/j+sJ17dnpXzkUZPO6GTcXlH/vm5I3etQppF6KcJT77frE9VwIKztEMYtH3 1Rww== 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; bh=y/ODGq4bxRX+7vRH9EfRNHPQ79as4a6DGbu+P98atT8=; b=l0MTITE8S9amcqcDVH+bElunTtXnQyJBzo2ExaRMaPSCLu/BSnYcMmVfrpiT+N9F2J KMVc1OWFLje2mlZiidw9wtz8rmmbiK7Hfr6D55sd4lmILcC21sn4VRJlta70jsZWnn3v OIglhhgoCiaCf015S5Y6ZvzMFmSAHGsiIuwE0oXW7l0uaBaD2I4ZKMsA6A4kcOjICvoZ NZ37zME7qD+jtyMeJbEDgrF5V9IP/x0QdjqXeQOU1djWiIm3dAPGLI4+ImjeFVVPl6XM Q/OKYmsuli0xMgg9ZHBdm0x+xGMP8nBVkYcX282tlVyFBO41eWUCTOotY0fYzraf+Huf M5LQ== X-Gm-Message-State: ALKqPwclyHQfPJeXSgWw9jSXHQ4+5BOLgtSPugUz6WaWjS8Kr5W7KcV4 vVi5S8muzWzsqzQlCmRvgTh5Ow== X-Google-Smtp-Source: ADUXVKK++Ak6mZ1FHoJllZ1Z3r51eyhI+z6biZ9PdFkzw04xFerMIzSG366GpuHR3UxdtkIrqDHf4g== X-Received: by 2002:adf:9f4a:: with SMTP id f10-v6mr5425366wrg.216.1527775309806; Thu, 31 May 2018 07:01:49 -0700 (PDT) Received: from pc-bage.fritz.box (x4db0a33a.dyn.telefonica.de. [77.176.163.58]) by smtp.gmail.com with ESMTPSA id o4-v6sm23464877wrp.19.2018.05.31.07.01.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 07:01:49 -0700 (PDT) From: Bastian Germann To: Luca Tettamanti Cc: Bastian Germann , Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] hwmon: (asus_atk0110) Remove unused manual sysfs file management Date: Thu, 31 May 2018 16:01:36 +0200 Message-Id: <20180531140136.13969-2-bastiangermann@fishpost.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180531140136.13969-1-bastiangermann@fishpost.de> References: <20180531140136.13969-1-bastiangermann@fishpost.de> 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 Remove the manual sysfs file creation and deletion that are now taken care of by the (un)register calls via an attribute_group array. Signed-off-by: Bastian Germann --- drivers/hwmon/asus_atk0110.c | 46 ------------------------------------ 1 file changed, 46 deletions(-) diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index 8a35fb27ff50..2f4955ec8437 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c @@ -263,14 +263,6 @@ static ssize_t atk_limit2_show(struct device *dev, return sprintf(buf, "%lld\n", value); } -static ssize_t atk_name_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - return sprintf(buf, "atk0110\n"); -} -static struct device_attribute atk_name_attr = - __ATTR(name, 0444, atk_name_show, NULL); - static void atk_init_attribute(struct device_attribute *attr, char *name, sysfs_show_func show) { @@ -1194,44 +1186,6 @@ static int atk_enumerate_new_hwmon(struct atk_data *data) return err; } -static int atk_create_files(struct atk_data *data) -{ - struct atk_sensor_data *s; - int err; - - list_for_each_entry(s, &data->sensor_list, list) { - err = device_create_file(data->hwmon_dev, &s->input_attr); - if (err) - return err; - err = device_create_file(data->hwmon_dev, &s->label_attr); - if (err) - return err; - err = device_create_file(data->hwmon_dev, &s->limit1_attr); - if (err) - return err; - err = device_create_file(data->hwmon_dev, &s->limit2_attr); - if (err) - return err; - } - - err = device_create_file(data->hwmon_dev, &atk_name_attr); - - return err; -} - -static void atk_remove_files(struct atk_data *data) -{ - struct atk_sensor_data *s; - - list_for_each_entry(s, &data->sensor_list, list) { - device_remove_file(data->hwmon_dev, &s->input_attr); - device_remove_file(data->hwmon_dev, &s->label_attr); - device_remove_file(data->hwmon_dev, &s->limit1_attr); - device_remove_file(data->hwmon_dev, &s->limit2_attr); - } - device_remove_file(data->hwmon_dev, &atk_name_attr); -} - static void atk_free_sensors(struct atk_data *data) { struct list_head *head = &data->sensor_list;