From patchwork Tue Jun 28 19:39:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1649694 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=QDIZ0azX; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LXZp74Cvvz9sGp for ; Wed, 29 Jun 2022 05:45:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232026AbiF1Tpt (ORCPT ); Tue, 28 Jun 2022 15:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231454AbiF1Tp3 (ORCPT ); Tue, 28 Jun 2022 15:45:29 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA003BF8E; Tue, 28 Jun 2022 12:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656445144; x=1687981144; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WFRvrLrs78r9lnnA1EVYp7hsPys2q5PlSUAARxpTtuQ=; b=QDIZ0azXgtPNSaFEzJiZnzabbHkVymkcQjtcwMR8lJRE5+SHi51WkqYU v2DLRRMYEwQ8OrZ0fimOLCmH7Di8omel6gavWYDbdrXCXnVL3Zf/sfOLe lroNofva8glxIwG5lW2WVocbW17p9sPlw7TyhqdApHzyh8cs17/RtjZzC RvUyJEDyA/NdvgZATVqcHP5xokINscbXA10RiTgo3+OcXuVi6z+ufEczx K6/F/qbYqQp16wfofWYZmiZWvUkOqG9/2IbLQtJre9H9Ybhvd3YdPferz rre5Mxg1cxiXGAfSP231DIZxEBQEFrBgG3piGEOsL0XMktfOkUJELjaTb w==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="262241171" X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="262241171" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 12:39:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="540596666" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 28 Jun 2022 12:39:02 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 37383F1; Tue, 28 Jun 2022 22:39:08 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Hennerich , Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 1/3] gpio: adp5588: Switch from of headers to mod_devicetable.h Date: Tue, 28 Jun 2022 22:39:03 +0300 Message-Id: <20220628193906.36350-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org There is nothing directly using of specific interfaces in this driver, so lets not include the headers. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-adp5588.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c index e388e75103f4..51ed23ba4645 100644 --- a/drivers/gpio/gpio-adp5588.c +++ b/drivers/gpio/gpio-adp5588.c @@ -6,7 +6,6 @@ * Copyright 2009-2010 Analog Devices Inc. */ -#include #include #include #include @@ -14,7 +13,8 @@ #include #include #include -#include +#include +#include #include @@ -427,18 +427,16 @@ static const struct i2c_device_id adp5588_gpio_id[] = { }; MODULE_DEVICE_TABLE(i2c, adp5588_gpio_id); -#ifdef CONFIG_OF static const struct of_device_id adp5588_gpio_of_id[] = { { .compatible = "adi," DRV_NAME, }, {}, }; MODULE_DEVICE_TABLE(of, adp5588_gpio_of_id); -#endif static struct i2c_driver adp5588_gpio_driver = { .driver = { .name = DRV_NAME, - .of_match_table = of_match_ptr(adp5588_gpio_of_id), + .of_match_table = adp5588_gpio_of_id, }, .probe_new = adp5588_gpio_probe, .remove = adp5588_gpio_remove, From patchwork Tue Jun 28 19:39:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1649695 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=mfbf2hDg; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LXZp81b5Yz9sGv for ; Wed, 29 Jun 2022 05:45:52 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbiF1Tpt (ORCPT ); Tue, 28 Jun 2022 15:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231458AbiF1Tp3 (ORCPT ); Tue, 28 Jun 2022 15:45:29 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B43843BF86; Tue, 28 Jun 2022 12:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656445144; x=1687981144; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EYFhbi3TG2EnqrzqyyS6XxZn5TtJ3mVQBigxsTKAzDo=; b=mfbf2hDgwcJ5v/BLrejs1ZY853B/SjvzvYyXifOuaxOGiHN7NqLJ41Eb hARRI/FY+NeVP3goYtCgayAsJK6eItyw4oTYsAkl0K9KEvHIH5yjiGUY9 wlprsNmY1+azXJN8h1cW6nJbV5MrwCZTI6RP8i2KCNERvM4QtJXlFQQt8 6bIx1SMuEvYOe/EiABRLlGBZsV+SVYEn3esM5ZqYrn9RhUkKGnkgEsjHK e4kMLOefcuZLawo0NF/dQv+SXoArQHbHdsYRz6kDqSoBRf8VpKneGzQbf QdNf2xReZW3rIjdTxTk9VCnKbJy5sNN8E75hBRyNx19yg5BUtU+NzoEmu g==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="270593025" X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="270593025" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 12:39:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="680179279" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 28 Jun 2022 12:39:02 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 40429CE; Tue, 28 Jun 2022 22:39:08 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Hennerich , Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 2/3] gpio: adp5588: Do not use defined value for driver name and compatible Date: Tue, 28 Jun 2022 22:39:04 +0300 Message-Id: <20220628193906.36350-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220628193906.36350-1-andriy.shevchenko@linux.intel.com> References: <20220628193906.36350-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org It's wrong to use defined string literal for three semantically different cases, i.e.: 1) compatible string, which is part of ABI and has to have specific format; 2) I2C ID, which is user space visible and also ABI; 3) driver name, that can be changed. Drop the define and use appropriate string literals in place. While at it, drop comma at terminator entry of OF ID table. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-adp5588.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c index 51ed23ba4645..d6a229a67044 100644 --- a/drivers/gpio/gpio-adp5588.c +++ b/drivers/gpio/gpio-adp5588.c @@ -18,8 +18,6 @@ #include -#define DRV_NAME "adp5588-gpio" - /* * Early pre 4.0 Silicon required to delay readout by at least 25ms, * since the Event Counter Register updated 25ms after the interrupt @@ -422,20 +420,20 @@ static int adp5588_gpio_remove(struct i2c_client *client) } static const struct i2c_device_id adp5588_gpio_id[] = { - {DRV_NAME, 0}, + { "adp5588-gpio" }, {} }; MODULE_DEVICE_TABLE(i2c, adp5588_gpio_id); static const struct of_device_id adp5588_gpio_of_id[] = { - { .compatible = "adi," DRV_NAME, }, - {}, + { .compatible = "adi,adp5588-gpio" }, + {} }; MODULE_DEVICE_TABLE(of, adp5588_gpio_of_id); static struct i2c_driver adp5588_gpio_driver = { .driver = { - .name = DRV_NAME, + .name = "adp5588-gpio", .of_match_table = adp5588_gpio_of_id, }, .probe_new = adp5588_gpio_probe, From patchwork Tue Jun 28 19:39:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1649693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=IEnBJc3q; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LXZp659hCz9sG2 for ; Wed, 29 Jun 2022 05:45:50 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbiF1Tps (ORCPT ); Tue, 28 Jun 2022 15:45:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231396AbiF1Tp3 (ORCPT ); Tue, 28 Jun 2022 15:45:29 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 829D6393C8; Tue, 28 Jun 2022 12:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656445144; x=1687981144; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+1EpxwGS9Cq1c0vv29dIM1+KCfkLYVP7Y5EIdg4E8Uo=; b=IEnBJc3qECYCzWlsJcpWZeWYFy1ceTP2KFtw2BD1cRaP4GFzds+UC0Li Ik7ubh9R7cGyNhG8htLKLbfrVzP6Ny+pSmwYIP/Ps9ANkKGmRAq6YBC65 9+Nm4WB0xj8NwYir1XGju51iw894T2kzQLaDp///WSsYNc2TYe9Mtqibr Ail/zA3QrEsyrUA+PGsS80rsE/ea2XKUz0m7l3HVrqVPMjbzZ35UvLr3F waQ/spYWG2kPyq7TimCQ0ZdrtjlWDo5i+mDZmnsx0SQTOQsOZSsdTk6a2 +Ko0Cad7QXfu8AutYU+xmrlkW29iOASgLwHiyNZTBYm5OVoWPGj5DXDiF w==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="368145176" X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="368145176" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 12:39:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="767286192" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 28 Jun 2022 12:39:02 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4BF8314F; Tue, 28 Jun 2022 22:39:08 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Hennerich , Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 3/3] gpio: adp5588: sort header inclusion alphabetically Date: Tue, 28 Jun 2022 22:39:05 +0300 Message-Id: <20220628193906.36350-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220628193906.36350-1-andriy.shevchenko@linux.intel.com> References: <20220628193906.36350-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Sort header inclusion alphabetically. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-adp5588.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c index d6a229a67044..d49f12560cde 100644 --- a/drivers/gpio/gpio-adp5588.c +++ b/drivers/gpio/gpio-adp5588.c @@ -6,15 +6,15 @@ * Copyright 2009-2010 Analog Devices Inc. */ -#include -#include -#include -#include #include +#include +#include #include #include +#include #include #include +#include #include