From patchwork Tue Jan 10 14:08:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13095217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45CCCC678DB for ; Tue, 10 Jan 2023 14:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234273AbjAJOIo (ORCPT ); Tue, 10 Jan 2023 09:08:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238672AbjAJOIM (ORCPT ); Tue, 10 Jan 2023 09:08:12 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B759C8CBF4; Tue, 10 Jan 2023 06:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673359691; x=1704895691; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bZMrAv2zUwB2PF0XruHl6FSmCHCHKSqmQ7n3sGCcVCE=; b=kGIN6TODYLjZv+PTgpD+w8v6ynn1FUnFiU7XJFmhDxUSBC8C0p/n2KuU NiJF7LEj1ZzVgleLe0vaizsPgmAPQCiZttNJ84/e/I/QiDTYiX87NVlsS gw/PFn6QWOHKmwlRXv1XQRbFw1oqR2scW657JSfvJv0h74tPuutH/6uNw D20FXNZcT9wMTjeMkJ7oyaORF4qn6EBXOgumBJ+jtz1rFtnOzqRUVGNy1 veRU6Hv0WrvZ1UXdskaHvsiIiSqIIhxs96OgqgTydSuGWxAZ/6CGVq0mc JCPx3RUdpKh3zFFj9iK467Zn004eoZQjiygfiZNYAwFEBJs4fTDAe1Yyk A==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="303513595" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="303513595" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 06:07:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="725555663" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="725555663" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 10 Jan 2023 06:07:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id E1B31E1; Tue, 10 Jan 2023 16:08:12 +0200 (EET) From: Andy Shevchenko To: Rasmus Villemoes , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: Alessandro Zummo , Alexandre Belloni , Jean Delvare , Guenter Roeck , Andy Shevchenko Subject: [PATCH v2 1/5] rtc: isl12022: Get rid of unneeded private struct isl12022 Date: Tue, 10 Jan 2023 16:08:02 +0200 Message-Id: <20230110140806.87432-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> References: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org First of all, the struct rtc_device pointer is kept in the managed resources, no need to keep it outside (no users in the driver). Second, replace private struct isl12022 with a regmap. Signed-off-by: Andy Shevchenko Acked-by: Rasmus Villemoes --- drivers/rtc/rtc-isl12022.c | 56 ++++++++++++++------------------------ 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index a3b0de3393f5..44058fa27277 100644 --- a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c @@ -46,11 +46,6 @@ static struct i2c_driver isl12022_driver; -struct isl12022 { - struct rtc_device *rtc; - struct regmap *regmap; -}; - static umode_t isl12022_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, int channel) @@ -67,8 +62,7 @@ static umode_t isl12022_hwmon_is_visible(const void *data, */ static int isl12022_hwmon_read_temp(struct device *dev, long *mC) { - struct isl12022 *isl12022 = dev_get_drvdata(dev); - struct regmap *regmap = isl12022->regmap; + struct regmap *regmap = dev_get_drvdata(dev); u8 temp_buf[2]; int temp, ret; @@ -115,23 +109,21 @@ static const struct hwmon_chip_info isl12022_hwmon_chip_info = { static void isl12022_hwmon_register(struct device *dev) { - struct isl12022 *isl12022; + struct regmap *regmap = dev_get_drvdata(dev); struct device *hwmon; int ret; if (!IS_REACHABLE(CONFIG_HWMON)) return; - isl12022 = dev_get_drvdata(dev); - - ret = regmap_update_bits(isl12022->regmap, ISL12022_REG_BETA, + ret = regmap_update_bits(regmap, ISL12022_REG_BETA, ISL12022_BETA_TSE, ISL12022_BETA_TSE); if (ret) { dev_warn(dev, "unable to enable temperature sensor\n"); return; } - hwmon = devm_hwmon_device_register_with_info(dev, "isl12022", isl12022, + hwmon = devm_hwmon_device_register_with_info(dev, "isl12022", regmap, &isl12022_hwmon_chip_info, NULL); if (IS_ERR(hwmon)) @@ -144,8 +136,7 @@ static void isl12022_hwmon_register(struct device *dev) */ static int isl12022_rtc_read_time(struct device *dev, struct rtc_time *tm) { - struct isl12022 *isl12022 = dev_get_drvdata(dev); - struct regmap *regmap = isl12022->regmap; + struct regmap *regmap = dev_get_drvdata(dev); uint8_t buf[ISL12022_REG_INT + 1]; int ret; @@ -190,8 +181,7 @@ static int isl12022_rtc_read_time(struct device *dev, struct rtc_time *tm) static int isl12022_rtc_set_time(struct device *dev, struct rtc_time *tm) { - struct isl12022 *isl12022 = dev_get_drvdata(dev); - struct regmap *regmap = isl12022->regmap; + struct regmap *regmap = dev_get_drvdata(dev); int ret; uint8_t buf[ISL12022_REG_DW + 1]; @@ -218,8 +208,7 @@ static int isl12022_rtc_set_time(struct device *dev, struct rtc_time *tm) buf[ISL12022_REG_DW] = tm->tm_wday & 0x07; - return regmap_bulk_write(isl12022->regmap, ISL12022_REG_SC, - buf, sizeof(buf)); + return regmap_bulk_write(regmap, ISL12022_REG_SC, buf, sizeof(buf)); } static const struct rtc_class_ops isl12022_rtc_ops = { @@ -235,34 +224,31 @@ static const struct regmap_config regmap_config = { static int isl12022_probe(struct i2c_client *client) { - struct isl12022 *isl12022; + struct rtc_device *rtc; + struct regmap *regmap; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) return -ENODEV; - isl12022 = devm_kzalloc(&client->dev, sizeof(struct isl12022), - GFP_KERNEL); - if (!isl12022) - return -ENOMEM; - dev_set_drvdata(&client->dev, isl12022); - - isl12022->regmap = devm_regmap_init_i2c(client, ®map_config); - if (IS_ERR(isl12022->regmap)) { + regmap = devm_regmap_init_i2c(client, ®map_config); + if (IS_ERR(regmap)) { dev_err(&client->dev, "regmap allocation failed\n"); - return PTR_ERR(isl12022->regmap); + return PTR_ERR(regmap); } + dev_set_drvdata(&client->dev, regmap); + isl12022_hwmon_register(&client->dev); - isl12022->rtc = devm_rtc_allocate_device(&client->dev); - if (IS_ERR(isl12022->rtc)) - return PTR_ERR(isl12022->rtc); + rtc = devm_rtc_allocate_device(&client->dev); + if (IS_ERR(rtc)) + return PTR_ERR(rtc); - isl12022->rtc->ops = &isl12022_rtc_ops; - isl12022->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; - isl12022->rtc->range_max = RTC_TIMESTAMP_END_2099; + rtc->ops = &isl12022_rtc_ops; + rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; + rtc->range_max = RTC_TIMESTAMP_END_2099; - return devm_rtc_register_device(isl12022->rtc); + return devm_rtc_register_device(rtc); } #ifdef CONFIG_OF From patchwork Tue Jan 10 14:08:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13095215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A985CC54EBE for ; Tue, 10 Jan 2023 14:08:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232799AbjAJOIn (ORCPT ); Tue, 10 Jan 2023 09:08:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238668AbjAJOIM (ORCPT ); Tue, 10 Jan 2023 09:08:12 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A8523C38C; Tue, 10 Jan 2023 06:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673359691; x=1704895691; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=k3cvIiiipTOOOJMkBjXRIczi8x3kZeinL1bpJ1JiSWA=; b=iuPOA6Oico/UR5QcKxLppKjC5FrLlKFV+8MniAbPnhMwi5wnrapIapB0 qwwzVz9xGgNr0aAjGXKr+Zm981C8bhsX6YCC2tYOq2bwtdLa4y2u0qEAJ NIx87KVvBFblkeGvr+cs7LHnBPMa5McUInVMjN8ljoGaSNjhTvrGgif+T egcrcrCDKkAU/J3psEW5QWvPOdxXKisqhhXro01FTT7seYrJ5K8HbG3Ct 5vG/+3BMJnRjEjcgPe5WXIwP1nbPR7jJOtaKkuCb0qtvirTCoKPIqTMK1 v4OFGThikhwpZYcijwfD4BAlREFv/3VsosA7JowM5JaAaaXLHW7mpl7sx g==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="303513589" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="303513589" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 06:07:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="725555661" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="725555661" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 10 Jan 2023 06:07:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id F19D91A3; Tue, 10 Jan 2023 16:08:12 +0200 (EET) From: Andy Shevchenko To: Rasmus Villemoes , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: Alessandro Zummo , Alexandre Belloni , Jean Delvare , Guenter Roeck , Andy Shevchenko Subject: [PATCH v2 2/5] rtc: isl12022: Explicitly use __le16 type for ISL12022_REG_TEMP_L Date: Tue, 10 Jan 2023 16:08:03 +0200 Message-Id: <20230110140806.87432-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> References: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org We are reading 10-bit value in a 16-bit register in LE format. Make this explicit by using __le16 type for it and corresponding conversion function. Signed-off-by: Andy Shevchenko Acked-by: Rasmus Villemoes --- drivers/rtc/rtc-isl12022.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index 44058fa27277..bf1aa6f6560d 100644 --- a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c @@ -19,6 +19,8 @@ #include #include +#include + /* ISL register offsets */ #define ISL12022_REG_SC 0x00 #define ISL12022_REG_MN 0x01 @@ -63,17 +65,16 @@ static umode_t isl12022_hwmon_is_visible(const void *data, static int isl12022_hwmon_read_temp(struct device *dev, long *mC) { struct regmap *regmap = dev_get_drvdata(dev); - u8 temp_buf[2]; int temp, ret; + __le16 buf; - ret = regmap_bulk_read(regmap, ISL12022_REG_TEMP_L, - temp_buf, sizeof(temp_buf)); + ret = regmap_bulk_read(regmap, ISL12022_REG_TEMP_L, &buf, sizeof(buf)); if (ret) return ret; /* * Temperature is represented as a 10-bit number, unit half-Kelvins. */ - temp = (temp_buf[1] << 8) | temp_buf[0]; + temp = le16_to_cpu(buf); temp *= 500; temp -= 273000; From patchwork Tue Jan 10 14:08:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13095213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C32B6C46467 for ; Tue, 10 Jan 2023 14:08:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232560AbjAJOHz (ORCPT ); Tue, 10 Jan 2023 09:07:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238655AbjAJOHm (ORCPT ); Tue, 10 Jan 2023 09:07:42 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291163FC83; Tue, 10 Jan 2023 06:07:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673359662; x=1704895662; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4eiyGTWXX+oD7HoJjkMNpYlz3/ZKnnaK5/dHNcnJkPA=; b=NbDDbR8iE534INn82Hz0vTgz0DWeEBxa9uJcVtPOpHXUhP9NeD3NE3qZ nXH3qnYx9oJL9Pw6MeAiZ2DiOs+SVJAmykHtXnVHgfcvrblN4a5B10Ggw c6NVhLbf2BAsKlPdXkTouiknofwOdelf7ZJf8L4LKQbdzS2O18E1DcBtf SQI8K5hoHM68gDqAKX4VU2umq/EK6tKSy27qogRlRPBD77CkTCjbaFOKZ M+wcDSZEXPJCOkMNyopqcx7gLM3kEVXVJWgVavgX2L+s+s90n1i2MKrmu nTmAENI8cMPFcHAIB0khak3v4UsmeriOGufEXrjP3fHFy9MfajuIlm8AB Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="325156487" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="325156487" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 06:07:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="606971782" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="606971782" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 10 Jan 2023 06:07:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 048AA31D; Tue, 10 Jan 2023 16:08:13 +0200 (EET) From: Andy Shevchenko To: Rasmus Villemoes , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: Alessandro Zummo , Alexandre Belloni , Jean Delvare , Guenter Roeck , Andy Shevchenko Subject: [PATCH v2 3/5] rtc: isl12022: Drop unneeded OF guards and of_match_ptr() Date: Tue, 10 Jan 2023 16:08:04 +0200 Message-Id: <20230110140806.87432-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> References: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Drop unneeded OF guards and of_match_ptr(). This allows use of the driver with other types of firmware such as ACPI PRP0001 based probing. Signed-off-by: Andy Shevchenko --- drivers/rtc/rtc-isl12022.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index bf1aa6f6560d..77b4763f2a70 100644 --- a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c @@ -14,8 +14,6 @@ #include #include #include -#include -#include #include #include @@ -46,8 +44,6 @@ #define ISL12022_BETA_TSE (1 << 7) -static struct i2c_driver isl12022_driver; - static umode_t isl12022_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, int channel) @@ -252,14 +248,12 @@ static int isl12022_probe(struct i2c_client *client) return devm_rtc_register_device(rtc); } -#ifdef CONFIG_OF static const struct of_device_id isl12022_dt_match[] = { { .compatible = "isl,isl12022" }, /* for backward compat., don't use */ { .compatible = "isil,isl12022" }, { }, }; MODULE_DEVICE_TABLE(of, isl12022_dt_match); -#endif static const struct i2c_device_id isl12022_id[] = { { "isl12022", 0 }, @@ -270,9 +264,7 @@ MODULE_DEVICE_TABLE(i2c, isl12022_id); static struct i2c_driver isl12022_driver = { .driver = { .name = "rtc-isl12022", -#ifdef CONFIG_OF - .of_match_table = of_match_ptr(isl12022_dt_match), -#endif + .of_match_table = isl12022_dt_match, }, .probe_new = isl12022_probe, .id_table = isl12022_id, From patchwork Tue Jan 10 14:08:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13095216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 121EFC678D8 for ; Tue, 10 Jan 2023 14:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233392AbjAJOIn (ORCPT ); Tue, 10 Jan 2023 09:08:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238663AbjAJOIL (ORCPT ); Tue, 10 Jan 2023 09:08:11 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7768CBE5; Tue, 10 Jan 2023 06:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673359690; x=1704895690; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/W8mB5CAUSKdgh4t9azmzmb5WV1al8YW28UpUk33I4Q=; b=I9QAyZYuqdLhy83alIrBBYvwuBWe++oloKXQ5Kd1xW53btF1T4RDsqzP KudknnZpHFQgRBpvVsGj94jtnD+wEYiZ7AA9IHCSXQcM3jodBwwPp7+69 DjbjkENR/Uhe8YgBoWGe9SJezWTTSA01c35rt9gXG4RuYf/oMnEcotUzz ndbGHdLpF5QrVIc9SVVHMtyYNHBC9Lhv0wd0+emI0IL2v5oiOSgQUMS9M fcaDo+jEE2TaBjtv1dbOWeZBxkWPOadn0LfzmyeEb3aqrqOPweK0nHNOC Z9CoERCBqluqYqqc9lGiaXcg5YYHOyZqKOqfw0FOtXzBBRGQ7g5FCZ+9d Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="303513579" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="303513579" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 06:07:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="725555662" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="725555662" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 10 Jan 2023 06:07:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0BA2F330; Tue, 10 Jan 2023 16:08:13 +0200 (EET) From: Andy Shevchenko To: Rasmus Villemoes , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: Alessandro Zummo , Alexandre Belloni , Jean Delvare , Guenter Roeck , Andy Shevchenko Subject: [PATCH v2 4/5] rtc: isl12022: Join string literals back Date: Tue, 10 Jan 2023 16:08:05 +0200 Message-Id: <20230110140806.87432-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> References: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org For easy grepping on debug purposes join string literals back in the messages. While at it, drop __func__ parameter from unique enough dev_dbg() message as Dynamic Debug can retrieve this at run time. Signed-off-by: Andy Shevchenko Acked-by: Rasmus Villemoes --- drivers/rtc/rtc-isl12022.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index 77b4763f2a70..ee38c5067ea8 100644 --- a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c @@ -143,16 +143,12 @@ static int isl12022_rtc_read_time(struct device *dev, struct rtc_time *tm) if (buf[ISL12022_REG_SR] & (ISL12022_SR_LBAT85 | ISL12022_SR_LBAT75)) { dev_warn(dev, - "voltage dropped below %u%%, " - "date and time is not reliable.\n", + "voltage dropped below %u%%, date and time is not reliable.\n", buf[ISL12022_REG_SR] & ISL12022_SR_LBAT85 ? 85 : 75); } dev_dbg(dev, - "%s: raw data is sec=%02x, min=%02x, hr=%02x, " - "mday=%02x, mon=%02x, year=%02x, wday=%02x, " - "sr=%02x, int=%02x", - __func__, + "raw data is sec=%02x, min=%02x, hr=%02x, mday=%02x, mon=%02x, year=%02x, wday=%02x, sr=%02x, int=%02x", buf[ISL12022_REG_SC], buf[ISL12022_REG_MN], buf[ISL12022_REG_HR], From patchwork Tue Jan 10 14:08:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13095214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14422C46467 for ; Tue, 10 Jan 2023 14:08:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbjAJOIm (ORCPT ); Tue, 10 Jan 2023 09:08:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238673AbjAJOIN (ORCPT ); Tue, 10 Jan 2023 09:08:13 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B8F58CBE2; Tue, 10 Jan 2023 06:08:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673359692; x=1704895692; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4NOTfNW4jDLP34KQ7vuObhZRGJ9+73gybtn8mNZS7J4=; b=l75mJ+HL+1N2aIBmgFij+XfJj7/rOdqwPDjQSdzj5HuHm3qyIbXu5WMe 1+zMSJAoOOOGfd8ebRFXOxIEmIXfH5kvSygF2+7VznVX+/JCPzvpdbCiz wxYw7x8x/UNuid5qmR/zppUH+C77Foc6A67p4YRAgVxgXPagCXRozr7cX t3yFFkkysCj6IKgLRSxYFLmLpIsQiw0Wd2S7Nm+mlHBl40ypILSGSEQl/ Yqtds/g5TjgHuGQLvSCKjq+xls188IPjzdL9s4lYGYUMp2qGX3GKB4lje v/VOKmb1kD82hzOqsRyF/PIQwc3VRnKqENkqswcuE+pkPQEULViHS61RB A==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="303513607" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="303513607" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 06:07:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="725555694" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="725555694" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 10 Jan 2023 06:07:42 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 125EB4E3; Tue, 10 Jan 2023 16:08:13 +0200 (EET) From: Andy Shevchenko To: Rasmus Villemoes , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: Alessandro Zummo , Alexandre Belloni , Jean Delvare , Guenter Roeck , Andy Shevchenko Subject: [PATCH v2 5/5] rtc: isl12022: sort header inclusion alphabetically Date: Tue, 10 Jan 2023 16:08:06 +0200 Message-Id: <20230110140806.87432-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> References: <20230110140806.87432-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Sort header inclusion alphabetically for better maintenance. Signed-off-by: Andy Shevchenko Acked-by: Rasmus Villemoes --- drivers/rtc/rtc-isl12022.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index ee38c5067ea8..e68a79b5e00e 100644 --- a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c @@ -8,14 +8,14 @@ * by Alessandro Zummo . */ -#include #include -#include -#include -#include #include -#include #include +#include +#include +#include +#include +#include #include