From patchwork Thu Aug 22 13:05:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13773361 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 280A11C9DE6; Thu, 22 Aug 2024 13:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724332050; cv=none; b=cGcoALjrvicl0TG0lI0YzOyQA9B6YiDmqbzE6pk20q42wOTZrMMlLkuOQxZBaDkOoV1WWQCvq4Ijk166Uyflog//QYjAmfH3juwfK0r+FcGJ75dyY90p1odQxU/9D2YHHvWOtz7gssdUZByhAtTzhMP302zbuS4tBo0YE19EEvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724332050; c=relaxed/simple; bh=/rlxddwbYicul4rBDo1BXld1UO+9xY/hxGIyhvivpHc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ugt9BwXh31aYBGWLSFdKasj/AKCgtuD2MSqT4GnTuLUsF0zlglyw0ak7A3M1vglPtApYVnvl6+ZMoD7RN2nhCmHUyhSjZr9hnvIfUQhtGcRvOuH3hv+VlvNXl3+EOMw0tjtQ0ZYTUmmtt3f5QmlE1CdYhLI/aXOgW8af/sPN3VQ= 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=Ef19BmNW; arc=none smtp.client-ip=198.175.65.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ef19BmNW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724332049; x=1755868049; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/rlxddwbYicul4rBDo1BXld1UO+9xY/hxGIyhvivpHc=; b=Ef19BmNWjOqXwKD9+Lyg/IT/tW5nlvBEeCjKfIK8MYvK8XtM4pCu8kr8 nZcA+ECPF4nrwS9/m3NGHXkLXFD5qFvGPIPPJFFPp/RIC+0azKS8uT0Jc vK4TtPT4braVpbkiusBE0HNrZ1WU2yJ0Ooeovr4y5eiJK78pBAeTQwle9 jiU7B2+UBM5EBTYpEg8nWSXGn27MBoaipeOiH2ykyis+0QvJzJHbNp/gG lNb/acjVvXNy7qBRjv8dbGmAoiZq/KPqpwrefKqiGL7F1AGZLKpd++eNa fYG6XVd3uAR9Y7UeNuHLXzx8w6qusgsw3IlzpZXniy14M2gfKNQ+YFKwB w==; X-CSE-ConnectionGUID: BKz+GL+/TRm1ijO70zu2jQ== X-CSE-MsgGUID: RfopBOBkSkaAwxBL0GkvhA== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="26538871" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="26538871" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 06:07:28 -0700 X-CSE-ConnectionGUID: oK4VI3y9Sx+6mcSv+c49ug== X-CSE-MsgGUID: AHJOpWE8RqeEb+0L8vqJFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="61146771" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa007.fm.intel.com with ESMTP; 22 Aug 2024 06:07:24 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 83AF92AA; Thu, 22 Aug 2024 16:07:23 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , =?utf-8?q?Ilpo_J=C3=A4r?= =?utf-8?q?vinen?= , Andy Shevchenko , Hans de Goede , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Daniel Scally Subject: [PATCH v2 1/4] driver core: Ignore 0 in dev_err_probe() Date: Thu, 22 Aug 2024 16:05:38 +0300 Message-ID: <20240822130722.1261891-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240822130722.1261891-1-andriy.shevchenko@linux.intel.com> References: <20240822130722.1261891-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In the similar way, ignore 0 error code (AKA "success") in dev_err_probe(). This helps to simplify a code such as if (ret < 0) return dev_err_probe(int3472->dev, ret, err_msg); return ret; to return dev_err_probe(int3472->dev, ret, err_msg); Reviewed-by: Ilpo Järvinen Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman --- drivers/base/core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 4bc8b88d697e..830a14084bf6 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -4987,13 +4987,14 @@ define_dev_printk_level(_dev_info, KERN_INFO); * This helper implements common pattern present in probe functions for error * checking: print debug or error message depending if the error value is * -EPROBE_DEFER and propagate error upwards. + * * In case of -EPROBE_DEFER it sets also defer probe reason, which can be * checked later by reading devices_deferred debugfs attribute. * It replaces code sequence:: * * if (err != -EPROBE_DEFER) * dev_err(dev, ...); - * else + * else if (err) * dev_dbg(dev, ...); * return err; * @@ -5003,12 +5004,16 @@ define_dev_printk_level(_dev_info, KERN_INFO); * * Using this helper in your probe function is totally fine even if @err is * known to never be -EPROBE_DEFER. + * + * NOTE: The message is not going to be printed or saved in cases when @err + * is equal to -ENOMEM or 0. + * * The benefit compared to a normal dev_err() is the standardized format * of the error code, it being emitted symbolically (i.e. you get "EAGAIN" * instead of "-35") and the fact that the error code is returned which allows * more compact error paths. * - * Returns @err. + * Return: the value of @err. */ int dev_err_probe(const struct device *dev, int err, const char *fmt, ...) { @@ -5032,6 +5037,10 @@ int dev_err_probe(const struct device *dev, int err, const char *fmt, ...) */ break; + case 0: + /* Success, no need to issue an error message */ + break; + default: dev_err(dev, "error %pe: %pV", ERR_PTR(err), &vaf); break; From patchwork Thu Aug 22 13:05:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13773360 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 CA0401C93C1; Thu, 22 Aug 2024 13:07:27 +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=1724332049; cv=none; b=oVxhN5QLsIGUlmgALgUd7qH1S4Qyms+FRheJN9T+97d68AQ3cFJ3sh92SRnDBAmx9DTLur7feDStWQmZ4zLI2DnCT0Uy2idm2udHtaVGRfsFXkbHovGX36SNQzW+w0Atms31bMP4lYwzmzurvDaSxextSZ0rOlLPO3UCyS6tTbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724332049; c=relaxed/simple; bh=L2qNLRudhc0YZ2KaL1xe3yaBazItbuDfZ5NCkDGYGPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s6tEfDjwNFPTORlJMcry88ZZsyPAYsq++su1bofktJlxWYD2+msHIrXvJ+XMlrzZexxVb39+ZxkAhwpWp1u/yVXTw6HSkwirHT8L6B6HIit13NoVQTnHM4UX7FkVXsYf4bGOo6Dx2MVQUyYJb0hh/avAxjokaju8PU8u3mfscIs= 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=kZRkXCzi; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kZRkXCzi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724332048; x=1755868048; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L2qNLRudhc0YZ2KaL1xe3yaBazItbuDfZ5NCkDGYGPk=; b=kZRkXCzi4chne2R8aTAUr9/mg2EM2981JQhO/F0jlXd76wYmxsoODZVg F9i7helZzOIAozySY90AE0SVXVDVrmJvrpiVDcSPMYs/a1tiXphty+d7l RZk8FVSiSD2p5P34t5G4E4COVt57sL0VkMYgAdXbfdbP3QFrtrGPZ9hWE diLaQURUXXupsccZP9hf/Diuco1B0Yf7AMm6Itv5iz7z7g0vuFha//xhV T/FJ34Cb/T7VkuZ7Wjfdr/E+KY++DNfL9uqiP4SChiPGwtpuZTRn34fde dav0uE2zHQlkenOzHBAHTAeoAl1FXDuN8JOpZYzqLe0L/pQPTXIMV2Ag7 w==; X-CSE-ConnectionGUID: wsEMzbJwTnCuAtlOuhaLDw== X-CSE-MsgGUID: CckQ9mn3Qnm2xGcF7pWFSQ== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22621709" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="22621709" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 06:07:27 -0700 X-CSE-ConnectionGUID: BBM/bMR6SnSHit7w0zYy5g== X-CSE-MsgGUID: Jqcd0QO1R6elZ3KAOEo5cw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="66363059" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 22 Aug 2024 06:07:25 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8DEEE43E; Thu, 22 Aug 2024 16:07:23 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , =?utf-8?q?Ilpo_J=C3=A4r?= =?utf-8?q?vinen?= , Andy Shevchenko , Hans de Goede , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Daniel Scally Subject: [PATCH v2 2/4] platform/x86: int3472: Simplify dev_err_probe() usage Date: Thu, 22 Aug 2024 16:05:39 +0300 Message-ID: <20240822130722.1261891-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240822130722.1261891-1-andriy.shevchenko@linux.intel.com> References: <20240822130722.1261891-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since dev_err_probe() ignores success, i.e. 0. we may call it unconditionally. Reviewed-by: Ilpo Järvinen Signed-off-by: Andy Shevchenko --- drivers/platform/x86/intel/int3472/discrete.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index 34db7d0381fd..29df19379464 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -299,10 +299,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, int3472->ngpios++; ACPI_FREE(obj); - if (ret < 0) - return dev_err_probe(int3472->dev, ret, err_msg); - - return ret; + return dev_err_probe(int3472->dev, ret, err_msg); } static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472) From patchwork Thu Aug 22 13:05:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13773362 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 5FFA71C9EAC; Thu, 22 Aug 2024 13:07: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=1724332050; cv=none; b=TA2qJVV67dkppo/vSDWvucs42s7ueSuHvC3jrhdLMe1Z15ybpZ87iGAQBjgSnk7KhNlSzmlJurCM7/6ayz6kU8XdhyphdJabgiStifp2K3FoZperD3WKh9lf4gEs+hEVnbwo8EERFvazDFXE49Nqsr1amNL6wSSRecrR1sjfZCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724332050; c=relaxed/simple; bh=OqnDzu9+ZUXGdtQdWMi+KA9baRD3epmipJVFFEG+fXg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Icx270Ii3ljawauecoStbEoNzNlHRxYFKunpXouTpb4fYMSefBDL7AMaGj0npe8YJbSmmstQi/GIZeuD0yMXKlAI5gfv/N/d49X73Muf08SSivmPGdvym6FGH2Hnn5KG1/xst7QO4IGTSPMDjCiMAQkvk2xCw12Nm9l4A7s7iec= 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=UBa9NbrU; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UBa9NbrU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724332050; x=1755868050; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OqnDzu9+ZUXGdtQdWMi+KA9baRD3epmipJVFFEG+fXg=; b=UBa9NbrUyN6UA4bh7dH9Q2Wc5QzXuIockut0b5OG7rmsW45/l7xqqVwd E9A/tP+44wYvE02FAfKlWFNivHBF+zkOv02YowxRj+Fo/xQYSFgTQ/4gS AZKjztmdwc4nekHAGn1Di1zVCEnyUieyPzPD0HBNFoTgMtBJp/qcAktsE 9vZTxFKjMo1Z0+sWqPLFtoHa/8soeAtXUx1x/QjjkIy5zHnvoKPix+g8F EmpGD6ApGcZZlhPyP/66U43rxm77zNfQaKXXFGaLVHFW3bcJkjDYBOR6J clZsPG5RNSForLFmcsBNjs6rbXH4T78xJeEas/iQce22wp4a1fUIvL/H7 g==; X-CSE-ConnectionGUID: rVNG4oZSSbit29v76+UNYg== X-CSE-MsgGUID: rMGNNms7QJS02SoenqxeBg== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22621716" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="22621716" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 06:07:27 -0700 X-CSE-ConnectionGUID: 3G/r6TtETPSpG7yPi+/cLg== X-CSE-MsgGUID: Nl++LU2QRnOGqCaGmbBKPg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="66363060" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 22 Aug 2024 06:07:25 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9C43D4D7; Thu, 22 Aug 2024 16:07:23 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , =?utf-8?q?Ilpo_J=C3=A4r?= =?utf-8?q?vinen?= , Andy Shevchenko , Hans de Goede , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Daniel Scally Subject: [PATCH v2 3/4] platform/x86: int3472: Use GPIO_LOOKUP() macro Date: Thu, 22 Aug 2024 16:05:40 +0300 Message-ID: <20240822130722.1261891-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240822130722.1261891-1-andriy.shevchenko@linux.intel.com> References: <20240822130722.1261891-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use GPIO_LOOKUP() macro which provides a compound literal and can be used with dynamic data. Reviewed-by: Ilpo Järvinen Signed-off-by: Andy Shevchenko --- drivers/platform/x86/intel/int3472/discrete.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index 29df19379464..a360901d03f0 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -69,11 +69,7 @@ static int skl_int3472_fill_gpiod_lookup(struct gpiod_lookup *table_entry, if (!adev) return -ENODEV; - table_entry->key = acpi_dev_name(adev); - table_entry->chip_hwnum = agpio->pin_table[0]; - table_entry->con_id = func; - table_entry->idx = 0; - table_entry->flags = polarity; + *table_entry = GPIO_LOOKUP(acpi_dev_name(adev), agpio->pin_table[0], func, polarity); return 0; } From patchwork Thu Aug 22 13:05:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13773363 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 B47191CBEA9; Thu, 22 Aug 2024 13:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724332060; cv=none; b=aVi2rwIlHjdj0X++FJAUGgI2TNRy7rnc2sXSKoM+DbOVytkCJhrMpXZvMjQdY/261U6sUxrlPp/CL2vXk4NkR1MX/PSc/8tcIh7FMU23oLaGxpIQ2hiKTaQyQxApabA2l8e7WQVDB2T2oSUD8KQAjb6AHo5DpOxAFjovgOSCpcw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724332060; c=relaxed/simple; bh=6yzkxgeeNpy0+7GerH1TmbwM9kjda6sRhMx93hTsO3k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ecyuTmCa/kKjo21kKflFbH2+H4uR0s3YKMLaGebFAtEAUWpLI8oLMKTWsdbmd9tcnKyeS2O05jsbjxRoSLKHwacjJMRX7hLBCaA+3CM4X1XzLn+bh2Ax8/AAdscO6CEHcSdVexYq1efv3cWUkn6AHVAxA6Ie8cWAwUAZQxb3JDw= 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=DCVFNsFB; arc=none smtp.client-ip=198.175.65.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="DCVFNsFB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724332058; x=1755868058; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6yzkxgeeNpy0+7GerH1TmbwM9kjda6sRhMx93hTsO3k=; b=DCVFNsFBlwzqMX+/jlAtdoClKE0dawN0Vq9JunE5sVdQDe2Ucl1dfJ6o sKQbAgr6SFrTUl9Dkecuo5WZxH7GmkfnyXhcbZsmuXUafLG3GOkn+ewCv ewQpOavmP9wU87AYby3e/3EAy7OARj6sraS6YOLP7Y2AZ1orTffcslRwK OC/WF9L0+uEMwWdrZNRmx1FKT0UxHk+XpP3cAE+eUX9CyTKxx1rUgCtCT eDtVYc8/bV9TDJSMlwhJKzw/j+Qs4GBqTJVKvzTQ4RHC7dALSWEgD7OZp FaxUq5Sld6WU+lOAKJvL5SRyEtbYSNOMwDl1YKByNc1XCGMUx+nqW7EjY w==; X-CSE-ConnectionGUID: a6tOBIvaSaqvTALI3azZsg== X-CSE-MsgGUID: 9uVBiN6YQU6vFTQ9aA5STg== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="26538887" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="26538887" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 06:07:38 -0700 X-CSE-ConnectionGUID: GhF9q9DCRZu6KIHJfg9RaQ== X-CSE-MsgGUID: bW4xKgsjQJKwf+eqvTGVTA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="61146785" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa007.fm.intel.com with ESMTP; 22 Aug 2024 06:07:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id AAF0C6CC; Thu, 22 Aug 2024 16:07:23 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , =?utf-8?q?Ilpo_J=C3=A4r?= =?utf-8?q?vinen?= , Andy Shevchenko , Hans de Goede , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Daniel Scally Subject: [PATCH v2 4/4] platform/x86: int3472: Use str_high_low() Date: Thu, 22 Aug 2024 16:05:41 +0300 Message-ID: <20240822130722.1261891-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240822130722.1261891-1-andriy.shevchenko@linux.intel.com> References: <20240822130722.1261891-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use str_high_low() rather than open coding. Reviewed-by: Ilpo Järvinen Signed-off-by: Andy Shevchenko --- drivers/platform/x86/intel/int3472/discrete.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index a360901d03f0..0559295dfb27 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "common.h" @@ -240,7 +241,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, dev_dbg(int3472->dev, "%s %s pin %d active-%s\n", func, agpio->resource_source.string_ptr, agpio->pin_table[0], - (polarity == GPIO_ACTIVE_HIGH) ? "high" : "low"); + str_high_low(polarity == GPIO_ACTIVE_HIGH)); switch (type) { case INT3472_GPIO_TYPE_RESET: