Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2513336lqb; Tue, 28 May 2024 02:06:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfnGEIdwscdeDGE9U2HHmALW1J2AsMsL/eVeKsAMEaZXyHS5lz9WsX3CuuuPCZ4mGqYIBMu+S6arpjzOY5RRiPG39voKujvj2ng3Itcw== X-Google-Smtp-Source: AGHT+IGBHftKkaMkXH5gxYaW33TMbAKS2Evhw76n0j9J+oKhJl9UTuzfqljBtL6F0D8aB+QeK6ry X-Received: by 2002:a17:906:3f87:b0:a59:aa3a:e6b6 with SMTP id a640c23a62f3a-a62641ded24mr685066166b.18.1716887199343; Tue, 28 May 2024 02:06:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716887199; cv=pass; d=google.com; s=arc-20160816; b=IXC3Befxyp2wdG35qI9jMaLwzkxeEIZKQ2Lpdc9taRaUonJ/9LqmTrQ/DfqZn4tvZI QrEVrZWjfmOTcKDzaXYey4dPA26yxKEyjquTsjQYmmilA3m/+tprBD6aeLnitubl7elK 5BvUcrKTvPwlUC04DiYMcQlrrU04oa3fSCdVk8zjNZumNoDNLLM7hRtmL4k3urQh3JZw v7s12zmgYK7Rb3pYs3bgdedWUTlO47ZQ8NT0COUXz/q9Z6vj3JY2ct7XWwSj8cXkrInc rATRKGeIzfJvaIrztwem0mKUNi/GQnh1CKxqne9xM0NIMYT0+iZQMRgKDrf0lGjtRaBT PiEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:date:from :dkim-signature; bh=ZqLx5R8kadH0ZXdVGcFqIgU+McePNOPF4OMmjsdDJRw=; fh=ggt4NDDC1IIy5anG0PzvNkYOxrn5PKKly64kWR95Kew=; b=Db3COndD90jH4hawVDXm8n5zzppg4b4Y0EHMHyd3jekkc4LUscqPq/s17kH8UjFr5F d9FLe8H3h7vuTJcDy8vr3nFBdmPxq4XMt/kVtVXnm7ytMw9g6Fgbtd5m9MWtpXh1Fjsz ec0M2AKB7iWAtu86Q08N/A2eJkIc/hTetsoRUHg19908d5/rMUGHLNQg21CxnSMMVRfq DFLiwnu5LLjB8BH299T2NWF8Ge2oQ0eKdCrSP2/K77aeiWa1hUHXjhAKE7fzw/TXnSw6 qY36V8VGUSzSxZ0v4dcrnjO+0k8buBxWugIaTTzWt3dq8szhmMFDbKHFnikxbGPiPMmP MkXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="G/4ZaRa1"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-191985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c800fa7si492914966b.164.2024.05.28.02.06.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 02:06:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="G/4ZaRa1"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-191985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0D6A71F227AE for ; Tue, 28 May 2024 09:06:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D17F13D280; Tue, 28 May 2024 09:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="G/4ZaRa1" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF9A513C900; Tue, 28 May 2024 09:06:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716887191; cv=none; b=iHXRhQsVAkO/HM0rzxCwZ/yOO6Yrz11ETcmjmKweTPkdPfcdPouCzbRqTkUpOmsVCHL39fjbM8g5DXyijDZK9LtMSxNRzrQik+UnQrWtvabNkonmsa5KLwVnfUh3l9weCXNJfKCXXPwBGxCQigfpichAsXtRf3XNGMSZxNKOoMo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716887191; c=relaxed/simple; bh=97zLPqcch+dKygaOOtSr8G9b0pK6+E1o8OK+hZaJVKA=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=rnQK+8aiZsL+aW1ZmHn7fZHvBnUe6UwPNBPYIB8GaNT/MMZNXcUghYUKHshHMqH4hFnRq3+yH3ZdNl7kj8oJb1m51Eyip+o8kWdzuCDGQox4AxyGtZ/xTm6qQR1yfPzM8GArwHlfidjeLwHxgZvX+4SvXgOhKt5ozqyUOcgyyQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=G/4ZaRa1; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716887190; x=1748423190; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=97zLPqcch+dKygaOOtSr8G9b0pK6+E1o8OK+hZaJVKA=; b=G/4ZaRa16A23ZirioT+h9qEIHqM6HeFRqxct4hUSO3A3ZnikeE1SIgdc 2S/X6J1lmCucSZ/wBahE5aLIG1+HyyFpTPzI/zzFzL8byxY73QOWrtFOg HCMTml5At0BP4L+KHlrUey3meQpN+vDLDkmXhwQAA9dxYPZ4CN3yhzfoO DkHROtdyHdmnNo7C1O2apO6RA//TD2guyMnqmOc2ewV87GxTwljcaAsnf 39cszvtTtFqkzaZnDwH/YiEDWaHowpyv3YdV2Sd1cPZRUkyvYY5Mwv1A1 fk4Vfmwsu/LUXFJW8gPBPPA/cePZ3ver6ue7GGBJ+DkZ/zhIfdleFGk/I Q==; X-CSE-ConnectionGUID: 2GoH1GvXS0aubl/pjodB5A== X-CSE-MsgGUID: zfnrYMI6QyiSnMQFG+qDYQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13089625" X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="13089625" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 02:06:29 -0700 X-CSE-ConnectionGUID: 3Ix8TPURQ0KJJZ6L33mZ4g== X-CSE-MsgGUID: aXprAG21RE+PuZXiwYgO+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="65839440" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.144]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 02:06:27 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Tue, 28 May 2024 12:06:23 +0300 (EEST) To: "Luke D. Jones" cc: Hans de Goede , corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org, LKML Subject: Re: [PATCH 5/9] platform/x86: asus-wmi: use WMI_SIMPLE_SHOW in more places In-Reply-To: <20240528013626.14066-6-luke@ljones.dev> Message-ID: References: <20240528013626.14066-1-luke@ljones.dev> <20240528013626.14066-6-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Tue, 28 May 2024, Luke D. Jones wrote: > Further reduce code duplication by using the new macros in a few more > places. > > Signed-off-by: Luke D. Jones > --- > drivers/platform/x86/asus-wmi.c | 30 ++++-------------------------- > 1 file changed, 4 insertions(+), 26 deletions(-) > > diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c > index 5c03e28ff252..260548aa6a42 100644 > --- a/drivers/platform/x86/asus-wmi.c > +++ b/drivers/platform/x86/asus-wmi.c > @@ -813,19 +813,6 @@ static void asus_wmi_tablet_mode_get_state(struct asus_wmi *asus) > } > > /* dGPU ********************************************************************/ > -static ssize_t dgpu_disable_show(struct device *dev, > - struct device_attribute *attr, char *buf) > -{ > - struct asus_wmi *asus = dev_get_drvdata(dev); > - int result; > - > - result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_DGPU); > - if (result < 0) > - return result; > - > - return sysfs_emit(buf, "%d\n", result); > -} > - > /* > * A user may be required to store the value twice, typcial store first, then > * rescan PCI bus to activate power, then store a second time to save correctly. > @@ -875,22 +862,11 @@ static ssize_t dgpu_disable_store(struct device *dev, > > return count; > } > + > +WMI_SIMPLE_SHOW(dgpu_disable, "%d\n", ASUS_WMI_DEVID_DGPU); > static DEVICE_ATTR_RW(dgpu_disable); > > /* eGPU ********************************************************************/ > -static ssize_t egpu_enable_show(struct device *dev, > - struct device_attribute *attr, char *buf) > -{ > - struct asus_wmi *asus = dev_get_drvdata(dev); > - int result; > - > - result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_EGPU); > - if (result < 0) > - return result; > - > - return sysfs_emit(buf, "%d\n", result); > -} > - > /* The ACPI call to enable the eGPU also disables the internal dGPU */ > static ssize_t egpu_enable_store(struct device *dev, > struct device_attribute *attr, > @@ -943,6 +919,8 @@ static ssize_t egpu_enable_store(struct device *dev, > > return count; > } > + > +WMI_SIMPLE_SHOW(egpu_enable, "%d\n", ASUS_WMI_DEVID_EGPU); > static DEVICE_ATTR_RW(egpu_enable); It seems odd you do this subset in own patch. I think it would be more logical if you reorder patches 4 and 5. -- i.