From patchwork Wed May 26 12:47:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448572 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F560C47088 for ; Wed, 26 May 2021 12:49:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E91D4613D4 for ; Wed, 26 May 2021 12:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234818AbhEZMuj (ORCPT ); Wed, 26 May 2021 08:50:39 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56861 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234861AbhEZMs5 (ORCPT ); Wed, 26 May 2021 08:48:57 -0400 Received: from mail-ua1-f71.google.com ([209.85.222.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswX-0000vM-AG for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:25 +0000 Received: by mail-ua1-f71.google.com with SMTP id t19-20020ab021530000b029020bc458f62fso693942ual.20 for ; Wed, 26 May 2021 05:47:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lxlGt7UdLo9WhBrHrUnAMYLEvzBvX/vS3VzoKn9EqgQ=; b=pnux0/Zp/bEOt3oeyit1/4XlGE1TP6Jvys3TMkoJejs2TVbIp9FBOhArAiasdFZh+k g2isPeo8CC/t2xbOnL9ERsXV6b0e1cJkdYPhHaZ15NMuSvBnyiPUtWJ8DxwPTn+tJH5F gqPk3uNO2g1AX4/BD6KTv0ybEVLTE+e+DIXXX5FjcleoU/gOkRkOrfBVeJDTfCRUjbpJ qNGO7FIAd3jlDyy5Myh1WyM2kVKMSCkWdS6QDSLJ6fXmzvYJoudr1I/7f0+uZtGRL/4I wZJVjy7Jy9VMelOVQexe9xMxP/7LOZHsEvywbbyAJycXn/U0cRmzi3eDm5SpHhfbFa0z ijvA== X-Gm-Message-State: AOAM532GbMTBoM/r5ky6SsR7JxYhPeyzr31UlFmp5bhD22E60VWubbvf gQSmR4lHorYvk8iFtbGzgfee3REdbAmujOsZtz/3OZn6Y3pSRipseKtU9v2hhiFCFcKX3/W0jHF FFlEYpGAPecKJPci9Q1GA8zNhRof+9ev6rdF61ZE= X-Received: by 2002:a05:6122:c91:: with SMTP id ba17mr27607460vkb.8.1622033244396; Wed, 26 May 2021 05:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeHUz3scp7cdtBDvx3wZhYQgy/hPyyOLqDEXP9LcACOUFA0w4nitE9VfR17c6NvL1vm1QT3w== X-Received: by 2002:a05:6122:c91:: with SMTP id ba17mr27607437vkb.8.1622033244233; Wed, 26 May 2021 05:47:24 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:23 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 02/13] mfd: max8998: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:00 -0400 Message-Id: <20210526124711.33223-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. There is also no need to wrap it in a check for CONFIG_OF, because dev.of_node will be set only with OF support. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Remove check for CONFIG_OF --- drivers/mfd/max8998.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 785f8e9841b7..0eb15e611b67 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -155,11 +156,8 @@ static struct max8998_platform_data *max8998_i2c_parse_dt_pdata( static inline unsigned long max8998_i2c_get_driver_data(struct i2c_client *i2c, const struct i2c_device_id *id) { - if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { - const struct of_device_id *match; - match = of_match_node(max8998_dt_match, i2c->dev.of_node); - return (unsigned long)match->data; - } + if (i2c->dev.of_node) + return (unsigned long)of_device_get_match_data(&i2c->dev); return id->driver_data; } From patchwork Wed May 26 12:47:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448571 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AF92C47082 for ; Wed, 26 May 2021 12:50:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07015613D4 for ; Wed, 26 May 2021 12:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234891AbhEZMvf (ORCPT ); Wed, 26 May 2021 08:51:35 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56878 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234876AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -0400 Received: from mail-ua1-f69.google.com ([209.85.222.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswk-0000xB-PG for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:38 +0000 Received: by mail-ua1-f69.google.com with SMTP id z43-20020a9f372e0000b029020dcb32d820so727395uad.2 for ; Wed, 26 May 2021 05:47:38 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=VIi0UDETJWMz8r22ACVNYPInzss+jr7PKRHzj4F9CjI=; b=DLwAkGJZFVMUo97KsFIZLerLJtjo6WF7jnDDcBntzVAySpQC8nayPjrGQs7XDTLOnI /cTj2/brSzvX4uTsRsrC7f7mxBIFMCjHREmEdN/OXR4U4JDTEFvJT0dNzhAe8sv04buI /ZUonblQx8hG+FQ1R0dy4oEo0bcVSSbbFrLTfaKI+41qpkBQpCdb9tv+hFRMMSHPdZZF V3gUQ7Nm0h9KtVKIiVDNNZ0eeAuxZ9uDqwySVljS4i1v+Om2rKhednXz0sbwlaJKbvZ+ tRVrg/OIjgdktCO/r0coIfHUAwlvC5D2zv2gErFp8SEtCrjSz/zyYU70JoHPs6/FsNKX d2CQ== X-Gm-Message-State: AOAM532Oy6lf60hIwXg2wJVQPO6z28sLVahKxUj9va24u8vDN00gubDu 0s1PwRXLvrZzho9WKFo0hoWirpU5zW3zN/rOA/qxK8jbsmhKZRIGzFcuXYGdsE2egS2B/e8N043 Vgc7YF/z9w0fv2FvS6AHG2CLAmOqcPDzh5TdMdYA= X-Received: by 2002:a05:6102:321b:: with SMTP id r27mr29696987vsf.13.1622033257578; Wed, 26 May 2021 05:47:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVJ0GkIwUjj/SnT+ky43SozLjtVHQDTyQ4X8v8jZZwJZjmUrTyX1krLd+798CTd0BMRkeRUQ== X-Received: by 2002:a05:6102:321b:: with SMTP id r27mr29696940vsf.13.1622033257072; Wed, 26 May 2021 05:47:37 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:36 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Cc: Adam Thomson Subject: [RESEND PATCH v2 04/13] mfd: da9062: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:02 -0400 Message-Id: <20210526124711.33223-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. Signed-off-by: Krzysztof Kozlowski Acked-by: Adam Thomson --- Changes since v1: 1. Add Ack 2. Correct subject prefix --- drivers/mfd/da9062-core.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index 8d913375152d..01f8e10dfa55 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -622,7 +623,6 @@ static int da9062_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct da9062 *chip; - const struct of_device_id *match; unsigned int irq_base; const struct mfd_cell *cell; const struct regmap_irq_chip *irq_chip; @@ -635,15 +635,10 @@ static int da9062_i2c_probe(struct i2c_client *i2c, if (!chip) return -ENOMEM; - if (i2c->dev.of_node) { - match = of_match_node(da9062_dt_ids, i2c->dev.of_node); - if (!match) - return -EINVAL; - - chip->chip_type = (uintptr_t)match->data; - } else { + if (i2c->dev.of_node) + chip->chip_type = (uintptr_t)of_device_get_match_data(&i2c->dev); + else chip->chip_type = id->driver_data; - } i2c_set_clientdata(i2c, chip); chip->dev = &i2c->dev; From patchwork Wed May 26 12:47:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 395C7C4708A for ; Wed, 26 May 2021 12:51:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CF05613D4 for ; Wed, 26 May 2021 12:51:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233460AbhEZMwg (ORCPT ); Wed, 26 May 2021 08:52:36 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56884 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234878AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -0400 Received: from mail-vs1-f70.google.com ([209.85.217.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswl-0000xb-IP for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:39 +0000 Received: by mail-vs1-f70.google.com with SMTP id v27-20020a67c89b0000b02902227f70aa8fso193816vsk.6 for ; Wed, 26 May 2021 05:47:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gi5LKjjP0bjXDjYj7Ix3Hw0qKjf6CelOHRk1zXBWnaI=; b=ACdUtXsuMfmYMnBqChDQy+B/9j/69sWwI/E67R+4Uxkk7lJfDZ87LfD8JO26zKmpcX 5tKZAq/WrNg0oAmYhd9CAyyiLNhRuhf3rJoO2HHMLj57ZjIZJLDbYPffgzK9Fq7ZncrQ +5f4ehD8NyHdTPB59Zao79mXEQ6KSie79f3Xr+YyivoY5deMiz4xffaevbqUo90kuL1r Yuu7g4Pu5MVbujGZzVvMv2NIane0lApGFx0W9yJb3s73Wfs7iRVO7k/qNBO0qAK0uFrw s6cqednPot55Gv8KVxmzWnDAAQjSiaIn63s0Jp4cjOYK6SimN3M0QFs3i9SYPGhRrVNh Nl5w== X-Gm-Message-State: AOAM532XoFxq21cBpKdRzkktVOOETyH0lT4LimNbFL7sZxu+rR9H1CzI RdPyOOzsMwORxr3fbOCGHagDUt9kF4Xab56S6cyXBqxfFHNifC9cPvd9ud06/Ev/8rlDRGYDlqv 9qB1ND9U6IZitk/91fgTN1r9Gz2Cqc35g02nWawM= X-Received: by 2002:a67:1087:: with SMTP id 129mr29581337vsq.42.1622033258713; Wed, 26 May 2021 05:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCM8BjysU8Rx+YcwLvtbPPjwicIzKBwQd2iZE/2FBz/KnmsXQzCZ4DPoAcGK75nk/My7ZDuA== X-Received: by 2002:a67:1087:: with SMTP id 129mr29581327vsq.42.1622033258573; Wed, 26 May 2021 05:47:38 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:38 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 05/13] mfd: sec: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:03 -0400 Message-Id: <20210526124711.33223-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. There is also no need to wrap it in a check for CONFIG_OF, because dev.of_node will be set only with OF support. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Remove check for CONFIG_OF as suggested by Marek --- drivers/mfd/sec-core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 8d55992da19e..15dd4c579937 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -323,14 +324,9 @@ sec_pmic_i2c_parse_dt_pdata(struct device *dev) static inline unsigned long sec_i2c_get_driver_data(struct i2c_client *i2c, const struct i2c_device_id *id) { -#ifdef CONFIG_OF - if (i2c->dev.of_node) { - const struct of_device_id *match; + if (i2c->dev.of_node) + return (unsigned long)of_device_get_match_data(&i2c->dev); - match = of_match_node(sec_dt_match, i2c->dev.of_node); - return (unsigned long)match->data; - } -#endif return id->driver_data; } From patchwork Wed May 26 12:47:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448568 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 718CBC4708A for ; Wed, 26 May 2021 12:50:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56E886113D for ; Wed, 26 May 2021 12:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234246AbhEZMwZ (ORCPT ); Wed, 26 May 2021 08:52:25 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56931 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234919AbhEZMt1 (ORCPT ); Wed, 26 May 2021 08:49:27 -0400 Received: from mail-ua1-f72.google.com ([209.85.222.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsx1-00011Q-LQ for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:55 +0000 Received: by mail-ua1-f72.google.com with SMTP id b8-20020ab026c80000b029020f97f38cfcso726087uap.3 for ; Wed, 26 May 2021 05:47:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yas4eb6X58o/Bpn+7QlC+KUOEDd/pLhewc6kAqI5ERQ=; b=NWRXExz5YrBgnnsgFhTjzf8n0MStmn3O/h+EvMm7E+pHmz5vPSr3vQUnT4rz0cJ6Vv tyhbNxYDjxFRuxDitHqVDfZo84lz6wL5Ff9lGQOKeGJ9PKKavLiATFQ91mtAy8YDKzg4 2sZICXnZ9ZBk8OqcnDNUJImHA0YPlDHQ6TDucVBMATh2tDLxj6PONr2vH4RpfRtxkwug EtDnGGEr1MFeWu5INAF9v0D3WSsvUNrYwmoZACqz0+e1D14YljEX4aljKrchdbeRXSY7 S4u2tsPZangNtXAVAWJJRYIwlZL4tEFVlxHSpC3DfgLkym9RHpzdQkpnbe/0vEWilI1d INgA== X-Gm-Message-State: AOAM532dfyrxQw9RJViE7oYNYVD4Zx3kV+fL5V347jaxacTmRcPNa67t OG95lXEp2JSdUESucdHmHeimIxpZdWR4E7DpsOzpEPC9ySCzJ2tTBWkwW6bePxU8QTvuIX1iBL1 x9Gqrg7XlOyiHVHWdahk/rhvwaEhZqqcPeJzv3tc= X-Received: by 2002:a67:f303:: with SMTP id p3mr13195178vsf.37.1622033274859; Wed, 26 May 2021 05:47:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUp5kruxawn6cjhi4Yijw6pPdfl65zkfOmhAEzzR7+KwZhyv3ui12e7v0bfCZkpNWEQogC2g== X-Received: by 2002:a67:f303:: with SMTP id p3mr13195148vsf.37.1622033274657; Wed, 26 May 2021 05:47:54 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:53 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 10/13] mfd: sec: Remove unused device_type in platform data Date: Wed, 26 May 2021 08:47:08 -0400 Message-Id: <20210526124711.33223-11-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The 'device_type' field of platform data structure is not used and can be safely dropped. Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/sec-core.c | 5 +---- include/linux/mfd/samsung/core.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 653d02b98d53..4c4db3171ce6 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -318,7 +318,6 @@ static int sec_pmic_probe(struct i2c_client *i2c, struct sec_platform_data *pdata; const struct mfd_cell *sec_devs; struct sec_pmic_dev *sec_pmic; - unsigned long device_type; int ret, num_sec_devs; sec_pmic = devm_kzalloc(&i2c->dev, sizeof(struct sec_pmic_dev), @@ -330,16 +329,14 @@ static int sec_pmic_probe(struct i2c_client *i2c, sec_pmic->dev = &i2c->dev; sec_pmic->i2c = i2c; sec_pmic->irq = i2c->irq; - device_type = (unsigned long)of_device_get_match_data(sec_pmic->dev); pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev); if (IS_ERR(pdata)) { ret = PTR_ERR(pdata); return ret; } - pdata->device_type = device_type; - sec_pmic->device_type = pdata->device_type; + sec_pmic->device_type = (unsigned long)of_device_get_match_data(sec_pmic->dev); sec_pmic->irq_base = pdata->irq_base; sec_pmic->wakeup = pdata->wakeup; sec_pmic->pdata = pdata; diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 68afc2b97a41..bfde1b7c6303 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -81,7 +81,6 @@ int sec_irq_resume(struct sec_pmic_dev *sec_pmic); struct sec_platform_data { struct sec_regulator_data *regulators; struct sec_opmode_data *opmode; - int device_type; int num_regulators; int irq_base; From patchwork Wed May 26 12:47:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448569 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7996EC47089 for ; Wed, 26 May 2021 12:50:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59A006113D for ; Wed, 26 May 2021 12:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234353AbhEZMwQ (ORCPT ); Wed, 26 May 2021 08:52:16 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56944 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234934AbhEZMtc (ORCPT ); Wed, 26 May 2021 08:49:32 -0400 Received: from mail-ua1-f72.google.com ([209.85.222.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsx6-00012o-Qb for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:48:00 +0000 Received: by mail-ua1-f72.google.com with SMTP id t19-20020ab021530000b029020bc458f62fso694659ual.20 for ; Wed, 26 May 2021 05:48:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uIc+hPbkXVAFmDCofUL+b5FDgJB7wunjYixiHaMZC84=; b=XPh/izWzfGBd+M2wTzcBITsDDvM0Bar6St26+TbacLpbGLISyH4+hG7ul08BfiJe9s 4tfPzocntCrrju6AcSoqNhO0UkaaT9sv+JKaGNaGQFoZeGZzswg+rcSGLHgJ/hc5s5cA oPbwXQqtVUpBSGF8Cw4Wf9Wt2Lqn5st9p31CGc/N/UKiL9Jh4tA0jZO0TWsjSX/5C6Bs y8uQ9iP1J+rdimgt6VF2Y/9UPrdAAFWCLLYk8z3ydoeBUhnqxpocBOH8Au7lVMqnJrGi iTXLXMeuCrt/+v8bWOMYXPlVWPbMMmumSUAqyckWQWMwOTXEzS2l2vsjJzKweG+GQwxp 9voQ== X-Gm-Message-State: AOAM533rPdSnOFRKK8OsnzGaHdsa+aMQuROEmNmtTUIzQhBSfpcCMpmk bumYC8kQw/LXsG/DvvDk5qZgW3HPSsfiDod2jYVVCrqFI/GSnJiW+/52sJRPvFMbXKKYFCPrXaX 6maiOeyzozOFyNUM6zLoIigeRb/cZVoaqvlTRxZE= X-Received: by 2002:a05:6102:34d:: with SMTP id e13mr31166289vsa.31.1622033278871; Wed, 26 May 2021 05:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLUl9+FuXiCkKXpZ3BpbPb9nKcQP/WZDUuFCDhCOI3YfGCRJALALHfGFE0HuWGuTN1VN/SVQ== X-Received: by 2002:a05:6102:34d:: with SMTP id e13mr31166241vsa.31.1622033278318; Wed, 26 May 2021 05:47:58 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:57 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 11/13] mfd: sec: Remove unused irq_base in platform data Date: Wed, 26 May 2021 08:47:09 -0400 Message-Id: <20210526124711.33223-12-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The 'irq_base' field of platform data structure is not assigned, therefore its default value of 0 has no impact and can be safely dropped. Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/sec-core.c | 1 - drivers/mfd/sec-irq.c | 4 +--- include/linux/mfd/samsung/core.h | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 4c4db3171ce6..a9d4fbc51997 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -337,7 +337,6 @@ static int sec_pmic_probe(struct i2c_client *i2c, } sec_pmic->device_type = (unsigned long)of_device_get_match_data(sec_pmic->dev); - sec_pmic->irq_base = pdata->irq_base; sec_pmic->wakeup = pdata->wakeup; sec_pmic->pdata = pdata; diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c index a98c5d165039..e473c2fb42d5 100644 --- a/drivers/mfd/sec-irq.c +++ b/drivers/mfd/sec-irq.c @@ -444,7 +444,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) if (!sec_pmic->irq) { dev_warn(sec_pmic->dev, "No interrupt specified, no interrupts\n"); - sec_pmic->irq_base = 0; return 0; } @@ -482,8 +481,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) ret = devm_regmap_add_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic, sec_pmic->irq, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, - sec_pmic->irq_base, sec_irq_chip, - &sec_pmic->irq_data); + 0, sec_irq_chip, &sec_pmic->irq_data); if (ret != 0) { dev_err(sec_pmic->dev, "Failed to register IRQ chip: %d\n", ret); return ret; diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index bfde1b7c6303..9864f13b7814 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -67,7 +67,6 @@ struct sec_pmic_dev { struct i2c_client *i2c; unsigned long device_type; - int irq_base; int irq; struct regmap_irq_chip_data *irq_data; @@ -83,8 +82,6 @@ struct sec_platform_data { struct sec_opmode_data *opmode; int num_regulators; - int irq_base; - bool wakeup; bool buck_voltage_lock; From patchwork Wed May 26 12:47:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448570 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 314A7C47088 for ; Wed, 26 May 2021 12:50:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06D14613DC for ; Wed, 26 May 2021 12:50:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234928AbhEZMvx (ORCPT ); Wed, 26 May 2021 08:51:53 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56967 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234713AbhEZMth (ORCPT ); Wed, 26 May 2021 08:49:37 -0400 Received: from mail-vs1-f71.google.com ([209.85.217.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsxB-00014g-MB for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:48:05 +0000 Received: by mail-vs1-f71.google.com with SMTP id v15-20020a67c00f0000b029023607a23f3dso193305vsi.10 for ; Wed, 26 May 2021 05:48:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0G840/6Lxcb0Mf0VQ/EHwzTpuJEk0LuU0gTLTIwmZhs=; b=LUja/VyrzVvB8gIMppkIxTfT1zDGk7VHzHfKPqC5DfUsLB/mi0jugeEoswPhfgOdwr dVGPOHm0P6klpouSu7OOGW0u6QsdG723XO8XWTjmpYxXjRaFcXo0m3GCAHyRrnqPo2ED fuoLGGzFvjNAAdWNnlb6Kpof42GONdqqVhfcbI00qiQFHVlH5zu0ORveLJJCRL3wrc3p DWYVdnrdW8/mbM+xDJeXnGU17UjFnLZbWpsH8mJR5Mps8/18MkV27EvvI0miX8oS94El GxWLjJt0G/se1ezEd3/BSQoONHB2MotvMNYnZG8dWAUNTn6Cb0c5/ruvXXXeloUGs3/4 lqRQ== X-Gm-Message-State: AOAM530fBjpIj639gbeqb4Cmvuv0+jyPGI7iRagIbd7PM6Vfyi2euSAf YgFNanxnOgcw7WvH8ye6iPWcNAkDS0heES9RU/MJywW7f55oZ2RcaGuJ4am9OY8ek1zLo6Ga/73 ciGlQhuqyQ1aXaLaZTCooY4YlYCBKo646To5sTmE= X-Received: by 2002:a67:ec4f:: with SMTP id z15mr29705037vso.27.1622033284477; Wed, 26 May 2021 05:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCoTnt6t9OzH8wpF2Ii6dBrFO6A3IuSsgipAxOrGMJk8cgaaL0/Ep+nV8/pkm14FWQbrzLzQ== X-Received: by 2002:a67:ec4f:: with SMTP id z15mr29705029vso.27.1622033284342; Wed, 26 May 2021 05:48:04 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:48:03 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 13/13] mfd: sec: Remove unused platform data members Date: Wed, 26 May 2021 08:47:11 -0400 Message-Id: <20210526124711.33223-14-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The Samsung PMIC drivers for early chipsets like S5M8767 stored quite a lot in platform data (struct sec_platform_data). The s5m8767 regulator driver currently references only some of its fields. Newer regulator drivers (e.g. s2mps11) use even less platform data fields. Clean up the structure to reduce memory footprint and source code size. Signed-off-by: Krzysztof Kozlowski --- include/linux/mfd/samsung/core.h | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index b0d049a56d16..f92fe090473d 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -80,8 +80,6 @@ struct sec_platform_data { struct sec_opmode_data *opmode; int num_regulators; - bool buck_voltage_lock; - int buck_gpios[3]; int buck_ds[3]; unsigned int buck2_voltage[8]; @@ -91,35 +89,12 @@ struct sec_platform_data { unsigned int buck4_voltage[8]; bool buck4_gpiodvs; - int buck_set1; - int buck_set2; - int buck_set3; - int buck2_enable; - int buck3_enable; - int buck4_enable; int buck_default_idx; - int buck2_default_idx; - int buck3_default_idx; - int buck4_default_idx; - int buck_ramp_delay; - int buck2_ramp_delay; - int buck34_ramp_delay; - int buck5_ramp_delay; - int buck16_ramp_delay; - int buck7810_ramp_delay; - int buck9_ramp_delay; - int buck24_ramp_delay; - int buck3_ramp_delay; - int buck7_ramp_delay; - int buck8910_ramp_delay; - - bool buck1_ramp_enable; bool buck2_ramp_enable; bool buck3_ramp_enable; bool buck4_ramp_enable; - bool buck6_ramp_enable; int buck2_init; int buck3_init;