From patchwork Wed May 26 12:46:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281535 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 7D8F0C47089 for ; Wed, 26 May 2021 12:49:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58E77613F5 for ; Wed, 26 May 2021 12:49:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234423AbhEZMua (ORCPT ); Wed, 26 May 2021 08:50:30 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56849 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234858AbhEZMs4 (ORCPT ); Wed, 26 May 2021 08:48:56 -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 1llswV-0000ug-Tv for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:23 +0000 Received: by mail-ua1-f69.google.com with SMTP id i33-20020ab042240000b029020adb6e9ffcso692887uai.23 for ; Wed, 26 May 2021 05:47:23 -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=63wtLBW+6811tc2wM3xGC8HMgV4U9MLtscg3Brvx6/I=; b=Zo+w+nBOcsvkgnBSHqU6uHevqRinCj0aACCWx1vDBTZZp/6nNGuCWTSXGiedbsch6L Dmco3XftmF7PxIIu3AoHesUBqg/+Dzn68jPm0c7kzLDQF6xnyvhC2E3LpcnnlRr0BrDf /huz+FNHUtpk03/FuNmsepW+MR7szH4msvWRwO0j4WlR0SpDnFtMZZuMI+4nkx3nulWX +OjFEtPYpFDaKdEhY1ynPd+2SSOIlCzOQJkE9YH1kQGnZ/+ltYfrJtigoiB5A+4V8nP5 M0kpCxukMkTnSM2oe8hHnJoRdwWl+RHRcGPsbRtNaUj786Bzzt9RTCUX3Z5C8CtNewjn yOVQ== X-Gm-Message-State: AOAM531DMSPLEexIhTF1YQPK2A0zUTyJo7SOSTzU5tOl4T6C0+ikRRAT fws3F4pRzeGZtlILIf5g198YSQIexdUHkZZTDDGPuToX4JlezC65C3dqcaaTm9574dH5MPoe9LY hBC0zNtYxwYwbBrRMcl/C4v+pbjYahIZE8WcQLi6EdFuQwoiz X-Received: by 2002:a1f:eec6:: with SMTP id m189mr28997969vkh.5.1622033242689; Wed, 26 May 2021 05:47:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGXY4h0rmF++o4wqDou76qRmdKHAt/W8UvAFVzu+jFZ3c1eLygDNepjjkFiySFdPpaAvkZPQ== X-Received: by 2002:a1f:eec6:: with SMTP id m189mr28997924vkh.5.1622033242172; Wed, 26 May 2021 05:47:22 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:21 -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 01/13] mfd: max8997: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:46:59 -0400 Message-Id: <20210526124711.33223-2-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-samsung-soc@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/max8997.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index 68d8f2b95287..2141de78115d 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -145,11 +146,9 @@ static struct max8997_platform_data *max8997_i2c_parse_dt_pdata( static inline unsigned long max8997_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(max8997_pmic_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: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: 12281537 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 08F0FC47082 for ; Wed, 26 May 2021 12:49:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFBD0613F4 for ; Wed, 26 May 2021 12:49:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234279AbhEZMug (ORCPT ); Wed, 26 May 2021 08:50:36 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56859 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234820AbhEZMs5 (ORCPT ); Wed, 26 May 2021 08:48:57 -0400 Received: from mail-ua1-f70.google.com ([209.85.222.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswX-0000vJ-8T for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:25 +0000 Received: by mail-ua1-f70.google.com with SMTP id o7-20020ab01e870000b029020d37e3e144so731947uak.1 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=RJw/5AmebhP9qF0Lw0Ny6xhDL58JhDzKOkGICtQOcbP18ROuiFiIIfwP5bVznZLDgY TkBfEyZbK5MMIqrXCprPyctOV6/zM3XfRHSyVbEQjm0IQ0622FlujXrSr3REr0gSD312 uBn/KRFbaJ0zVbFsQDeexXnDnkNyklTWt4RpI641e3nq75kVNNlilGUTcLR97dHFmaao DzqgwZt+DkcUxrtybXFW8Qv+yb9gFZmIMrk93SYtkjqlA40PBUEED+qUKUWTznWEArQn ThbRUN5zdUdmbe3g5LAlN+8xkz/TzMzhK/Eb2TtRIH5Qo0UlfX912cn/cggIQcfnLXww zdKw== X-Gm-Message-State: AOAM530mfk/ptB5S4zficC72wazMmzXmcme+rpnXvGief1yc1+0O9CCh GaU8LeAR9i9gI5JfEl9ABZnxEQZFIr/h+byX8kZC7/FzTdn43XhIOqFYETRaa0TFYsmjlSxK3zb JaU+M+Aqk65lN9XUHkbHbMs2Canpxh/06Tbv/koeSZKop75JA X-Received: by 2002:a05:6122:c91:: with SMTP id ba17mr27607454vkb.8.1622033244395; 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-samsung-soc@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:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281539 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 707D1C47082 for ; Wed, 26 May 2021 12:49:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 554646113D for ; Wed, 26 May 2021 12:49:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234827AbhEZMuv (ORCPT ); Wed, 26 May 2021 08:50:51 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56871 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234863AbhEZMs7 (ORCPT ); Wed, 26 May 2021 08:48:59 -0400 Received: from mail-vs1-f72.google.com ([209.85.217.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswZ-0000w7-C6 for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:27 +0000 Received: by mail-vs1-f72.google.com with SMTP id v15-20020a67c00f0000b029023607a23f3dso192772vsi.10 for ; Wed, 26 May 2021 05:47:27 -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=1o/+HiDWaRqbZ2KripZjBdfw0i27jwAjy/6T41yOkhc=; b=PBnHEp5WEIS51Q+En8EoOEyOc9nSogWJqoRGN8ctgcU0uBR/UK2jWUiOVk+D+gKgZd 9+SJMPpDg4nsXk2Jn+DB64fdYrhObft//2jzxHVYwLqG/azEXNtlG84mqctdK9S+u2Ae bYvH0AAjcNAl1lQEYyf/u+sQgITjfvuKbaB/MOQvi4Y62Kk+1AoZ0KMc1DjfVHZgIRkq PTVSCjscM68w0KL909E55NdWXotQ8wvFnHS7qRPkSBjjETjECjFFqR6d6xCIZhYJCvz6 svoYw5pp/lkWC+n3xrWTdBqGodKtxX46YSBPc8722C0Ik0UxXRuLFlHpdPHuZPteQa3O 2hxg== X-Gm-Message-State: AOAM5313TQvKoMBqP1iwjNw9nC1SKfV7+C3q74llNBbx1BFpWM7hcmx8 ldn7jFwgqI/TZKZpjhMNaZigcZtHNniO809DrYySq2mXWcww3cjLqWGAiDTIBSlwFHuIPoV7lVk jSFqJc55nvamNc2xWuRQeAYtlbbkY1tv/dcDKRrbn5vLj3UTB X-Received: by 2002:a1f:a802:: with SMTP id r2mr29795054vke.14.1622033246156; Wed, 26 May 2021 05:47:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyflJsx/GTGmueUvxCqoT3eN+/IS1gmrFHEClDPJbgqchaHkmkdQt0f9ZaB2/HCSu4kcXqjEQ== X-Received: by 2002:a1f:a802:: with SMTP id r2mr29795039vke.14.1622033246028; Wed, 26 May 2021 05:47:26 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:25 -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 03/13] mfd: da9052: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:01 -0400 Message-Id: <20210526124711.33223-4-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-samsung-soc@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 --- drivers/mfd/da9052-i2c.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c index 8ebfc7bbe4e0..8de93db35f3a 100644 --- a/drivers/mfd/da9052-i2c.c +++ b/drivers/mfd/da9052-i2c.c @@ -155,13 +155,8 @@ static int da9052_i2c_probe(struct i2c_client *client, return ret; #ifdef CONFIG_OF - if (!id) { - struct device_node *np = client->dev.of_node; - const struct of_device_id *deviceid; - - deviceid = of_match_node(dialog_dt_ids, np); - id = deviceid->data; - } + if (!id) + id = of_device_get_match_data(&client->dev); #endif if (!id) { 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: 12281553 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 43FD1C47088 for ; Wed, 26 May 2021 12:51:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BD3A6124B for ; Wed, 26 May 2021 12:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234908AbhEZMwe (ORCPT ); Wed, 26 May 2021 08:52:34 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56877 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -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 1llswk-0000xA-FS for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:38 +0000 Received: by mail-vs1-f71.google.com with SMTP id n26-20020a67d61a0000b029023651d629a4so197016vsj.0 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=DilMK6XVf487rBfpSDrmMr0we4UwATAQCkr9vNlgCSFJx6R6C4G9nYbC17WTTiwrn3 0mU+sOjNi/3iOMtlCi0krKvvqfySYagH0hoqWRKIDY7LfzCjejofl06MXHKqVfUdYobm w9UWKqKBeNUDiH8qmShG9Ee7Scc+JWuOQpLj7M5Lf9JDFCGtmHDlwOxmpLofpYGgKLis BvEmEjv9CE4szPntZw08ilG2SmFcIsyt19M0y7utL9lr8Li1epfm/kgnAQ8/lXhgvfg+ myIv/UVbEO8flHMLlmRZKPiTf6Ss93FMRCaFVSuKY3KYjhbaEQIk8YYA9SndZqFecGkS c9eQ== X-Gm-Message-State: AOAM530hFD4LOAG5vdRrwA/I8Z3dULVstrJ5jHLt3XLwC+EbwcUoIhwG JGSe2XEQ2DQ5ngZoH2fA8X0f4aDCX7j2Wvu5fgoj49zKVfmKa4t5aaiJ/oLV0S18JIUNhd2CwDS ew/JQhSA6tXes+SRYZgINdQ61qEvL+CSMEDjkMmvhKeV96jmZ X-Received: by 2002:a05:6102:321b:: with SMTP id r27mr29696991vsf.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-samsung-soc@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: 12281557 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 7A52CC47088 for ; Wed, 26 May 2021 12:51:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62647613DC for ; Wed, 26 May 2021 12:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234873AbhEZMwk (ORCPT ); Wed, 26 May 2021 08:52:40 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56891 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234880AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -0400 Received: from mail-vs1-f72.google.com ([209.85.217.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswl-0000xm-Vv for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:40 +0000 Received: by mail-vs1-f72.google.com with SMTP id h27-20020a67cb9b0000b0290235f3536140so193509vsl.12 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=JcVxVrZpCJzb2MWSFxRHwUbyJPbo30MCrNv2/Er7uNNOeOOVSsAiO1QZEgqvhYUEcH HaILKeFVRSdpw5oLu5HbIEmkVhFwC9BAPNxoT4c9McHJtOLc1k9IVbBsdZ9RkoVJvMq6 9cbvMdfk7kTrFzSQoMimwPeo0HO748mglitsdIg96fbnyAYEkLHNn6LaxenopkyeS9/5 eIqrCd0UHx4a6Ysc5tu3q9OmyX/EcU+ECzaQCshd7YGEnQ5mavLcXNhOEJvvGlOVfgbE fzpkoYm8+z+JoyamzCfHq6ltsy78LNYKM4sGExC4uI4kxqFIs3cyWniBgS8bucXoGf8r cLNw== X-Gm-Message-State: AOAM530ZjgoVbIDKP97B6HxzQeUjaCN8q+2r2TcmYD6GP+CpHNYDWCqn MfyDBr3G7wvgS7LB2GdiKIgfrathizCNh3PB7p17HhbxGekrRrNCFcLOCmFs/O4JGYYNpFe/FUY R/ZkMzY1lqtjABDcDM3TLGT+IeJuSEO4PMDdtU8KbHLWnfwao X-Received: by 2002:a67:1087:: with SMTP id 129mr29581340vsq.42.1622033258714; 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-samsung-soc@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:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281559 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 3F0E4C47088 for ; Wed, 26 May 2021 12:51:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E24B6124B for ; Wed, 26 May 2021 12:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234934AbhEZMwn (ORCPT ); Wed, 26 May 2021 08:52:43 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56899 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234882AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -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 1llswn-0000yf-Js for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:41 +0000 Received: by mail-ua1-f72.google.com with SMTP id k17-20020ab071510000b02902351d1972d8so696460uao.19 for ; Wed, 26 May 2021 05:47:41 -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=WIVLcdNNtMYgH1JGfFPDDOgy1+OAkNQskR3ugQF/qLg=; b=WlD393USfE9dPdE6zKzHGOMlTEqlGankyBvfDMck872w5vA8VjgaSwgiL24FR9Otdd d9g8uOMrzpjz0BGeeklpyLpSmfRUte0eH7b0H/+A7x0huTrHLShNnRyjtXZcqrsJiCe+ DEeeFGwV5P1N6MpBtphnXZfnBz4aCgJynv03GZfu2Q0bH4w9ZVGyCuWs2lUumrQCXdkA wxgHriJuT+xWAPkz/phXUKZsvjxcxMtvhLxBtwNyCE08kHkJIpj2dadHHPCR+hr9JBi2 aHPptWn3waJ6OJ1S8xP6+zMAem/EItQ0HamzRPcOsFM5LnLHeFYbpzOJt1UZjgRw1iJx Cd2Q== X-Gm-Message-State: AOAM531hhPyElRXZkaVhp4G3BEZr58EJib6D6z4saQRPIPrmT2xqvjz4 3+8zoLJT8ZSEnVs9ljzbRqarYVE4qQk2UdhrtompnsWvx7++sObpVaPooJXYpGMMcQq2SHoJ3/O MXuTnxqYxIn4rbp99NuV9Wpz9er/1Hw1wYBphuqLJKIoJBTps X-Received: by 2002:a67:ee07:: with SMTP id f7mr29741186vsp.55.1622033260712; Wed, 26 May 2021 05:47:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLAavyPatTn6lusqjCi70ec2x9vA5s1Emg7eGeEsn1Ovy17QVDFuG9G6nwebdsE/DwG++62w== X-Received: by 2002:a67:ee07:: with SMTP id f7mr29741168vsp.55.1622033260560; Wed, 26 May 2021 05:47:40 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:40 -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: Charles Keepax Subject: [RESEND PATCH v2 06/13] mfd: wm831x: Correct kerneldoc Date: Wed, 26 May 2021 08:47:04 -0400 Message-Id: <20210526124711.33223-7-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-samsung-soc@vger.kernel.org Correct kerneldoc function name to fix W=1 warning: drivers/mfd/wm831x-core.c:121: warning: expecting prototype for wm831x_reg_unlock(). Prototype was for wm831x_reg_lock() instead Signed-off-by: Krzysztof Kozlowski Acked-by: Charles Keepax --- Changes since v1: 1. Add Ack --- drivers/mfd/wm831x-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index bcef08f58fb3..c31809b17547 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c @@ -109,7 +109,7 @@ static int wm831x_reg_locked(struct wm831x *wm831x, unsigned short reg) } /** - * wm831x_reg_unlock: Unlock user keyed registers + * wm831x_reg_lock: Unlock user keyed registers * * The WM831x has a user key preventing writes to particularly * critical registers. This function locks those registers, From patchwork Wed May 26 12:47:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281555 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 23B51C47082 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 EA273613F1 for ; Wed, 26 May 2021 12:51:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234790AbhEZMwg (ORCPT ); Wed, 26 May 2021 08:52:36 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56911 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234873AbhEZMtP (ORCPT ); Wed, 26 May 2021 08:49:15 -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 1llswp-0000zQ-3h for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:43 +0000 Received: by mail-ua1-f71.google.com with SMTP id f2-20020ab006020000b02902124881cdf4so724229uaf.7 for ; Wed, 26 May 2021 05:47:43 -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=xmq4az+LVVwXfHSluC5ybVO0wHBrYm+QPRvC663g7hE=; b=qUVPITAVuWbFMcOFJ0qVBT9CN333s2AS8j0scxIdFyp28n7aSNDs6W6u+r9UaP+FG0 4SxzHiFT6+FEDDo9zg8HYU2Udn7AXN3eITJa9tcDF9fZiOPFrcj5g9EdAgSNoW5CHHKP WkIUm1hli9AJ/DXFlF1dsa6vsZJgVtQZ6kVBfxOlSj0xJFgFht1LAXIPYZEYMANNFndv KijMboczzVCgatMdlxUJctPvM348ezpZ6GZ0rmgktHxOvelbx7mLzDecCQUoWLLGyaxQ fH8Rel29TV3yx/Nr9HHk2eIZ4nohLcDUTZ0SxNs8kRXCk57l2wUKgd7tr0ZehKs2cPdV oI5g== X-Gm-Message-State: AOAM533zDEPwzPGL1ERpkCknqKSv0PbBc5sahzOO1/g38xcZUR+VowJh YiyOL8BQ0RkaiRF3mWrp3lZCTk7lh8WmZmN9jmWnx4Om4DMb69uNUMsx6s/lllls6Wd1XYU7e0J JKN4Tav2hR5jxjDOVNYZP++3c/7sNgSF8/+a4AYaHrQRfcG+D X-Received: by 2002:ab0:2690:: with SMTP id t16mr32616236uao.9.1622033262218; Wed, 26 May 2021 05:47:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAQIaZSYaw/87n9WsaeWRycw8n9xSrM+/O2sXVcNtI7Ic5NMnYJIKikee5mCmgG0Yw6URGoA== X-Received: by 2002:ab0:2690:: with SMTP id t16mr32616208uao.9.1622033262021; Wed, 26 May 2021 05:47:42 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:41 -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 07/13] mfd: twl: Correct kerneldoc Date: Wed, 26 May 2021 08:47:05 -0400 Message-Id: <20210526124711.33223-8-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-samsung-soc@vger.kernel.org Correct kerneldoc function name to fix W=1 warning: drivers/mfd/twl-core.c:496: warning: expecting prototype for twl_regcache_bypass(). Prototype was for twl_set_regcache_bypass() instead Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/twl-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 20cf8cfe4f3b..24b77b18b725 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -485,8 +485,8 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) EXPORT_SYMBOL(twl_i2c_read); /** - * twl_regcache_bypass - Configure the regcache bypass for the regmap associated - * with the module + * twl_set_regcache_bypass - Configure the regcache bypass for the regmap + * associated with the module * @mod_no: module number * @enable: Regcache bypass state * From patchwork Wed May 26 12:47:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281541 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 9610BC47082 for ; Wed, 26 May 2021 12:50:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7407B613DC for ; Wed, 26 May 2021 12:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234316AbhEZMv4 (ORCPT ); Wed, 26 May 2021 08:51:56 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56924 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234908AbhEZMt0 (ORCPT ); Wed, 26 May 2021 08:49:26 -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 1llsx0-00010h-4B for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:54 +0000 Received: by mail-ua1-f71.google.com with SMTP id d30-20020ab007de0000b029020e2f98646dso720582uaf.5 for ; Wed, 26 May 2021 05:47:54 -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=WStmZXvsQ5h7CfTVIuVnQjnA8EJCCjMgEO+OrcP4v9c=; b=kVSrgTp7DjjaveFSxtycRTBw40E0UE85HAoM54hvGWQoPxtGmct7wqYEBhFWUvTh9V BSkjdivHaNQoORtW7sDgVHYp5dtpoN4wRS6+StMchO4+qtCnweEZxfKe27sSEEPleG6x aQ+02uSOKJWTIWMdb4OOD/skXBw8ek2v52gNryfpmx5gTG9kaU3IowB8Wk20JeEQL4TI YLDym3TSDMHQ/qn8iqZcWqipbfOOOyMCZI88g6mYYKGglydL0siMr24JfRmibLu3JKpu CZYtgSLBa/kz/4QUW+UbFAD9Z2jn6V6tzR+9EcIlvt9UkxaTjgzg0RaCTetEXkovbr5l blWg== X-Gm-Message-State: AOAM530daQnOcDIV7i14aEo1e0ljmODCxYQST+DZmKjQRp3J442kckdj tDkDgUOE2r9+ZLrHs59v6JncWeErZorU8hl+Ax6h0GaW1OwdqUFWwm6AATewmElZxPXDJKJX8lK c1BSIuJmSi774CIzSM6KAf+EdVtMza6LVkIzjmKu3v5Fz8Voq X-Received: by 2002:a67:db03:: with SMTP id z3mr26669043vsj.29.1622033270703; Wed, 26 May 2021 05:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmmhpFUj6CK7bZ7dbqf7I816J0q4PtRcTDGOcM5jZDaT5rNIXCiaQhLvUio7RFOl1bks20HQ== X-Received: by 2002:a67:db03:: with SMTP id z3mr26668691vsj.29.1622033263826; Wed, 26 May 2021 05:47:43 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:43 -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: Marek Szyprowski Subject: [RESEND PATCH v2 08/13] mfd: sec: Drop support for board files and require devicetree Date: Wed, 26 May 2021 08:47:06 -0400 Message-Id: <20210526124711.33223-9-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-samsung-soc@vger.kernel.org The Samsung PMIC drivers since long time are used only on devicetree platforms (Samsung Exynos) and there are no users with board files. Drop the support for board files entirely and depend on OF for matching. Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/Kconfig | 1 + drivers/mfd/sec-core.c | 59 +++++++++++------------------------------- 2 files changed, 16 insertions(+), 44 deletions(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 5232bc0db8c0..219c09e15452 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1145,6 +1145,7 @@ config MFD_RN5T618 config MFD_SEC_CORE tristate "Samsung Electronics PMIC Series Support" depends on I2C=y + depends on OF || COMPILE_TEST select MFD_CORE select REGMAP_I2C select REGMAP_IRQ diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 15dd4c579937..c61c1fc62165 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -94,7 +94,6 @@ static const struct mfd_cell s2mpu02_devs[] = { { .name = "s2mpu02-regulator", }, }; -#ifdef CONFIG_OF static const struct of_device_id sec_dt_match[] = { { .compatible = "samsung,s5m8767-pmic", @@ -122,7 +121,6 @@ static const struct of_device_id sec_dt_match[] = { }, }; MODULE_DEVICE_TABLE(of, sec_dt_match); -#endif static bool s2mpa01_volatile(struct device *dev, unsigned int reg) { @@ -282,7 +280,6 @@ static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic) } } -#ifdef CONFIG_OF /* * Only the common platform data elements for s5m8767 are parsed here from the * device tree. Other sub-modules of s5m8767 such as pmic, rtc , charger and @@ -313,28 +310,12 @@ sec_pmic_i2c_parse_dt_pdata(struct device *dev) "samsung,s2mps11-wrstbi-ground"); return pd; } -#else -static struct sec_platform_data * -sec_pmic_i2c_parse_dt_pdata(struct device *dev) -{ - return NULL; -} -#endif - -static inline unsigned long sec_i2c_get_driver_data(struct i2c_client *i2c, - const struct i2c_device_id *id) -{ - if (i2c->dev.of_node) - return (unsigned long)of_device_get_match_data(&i2c->dev); - - return id->driver_data; -} static int sec_pmic_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev); const struct regmap_config *regmap; + struct sec_platform_data *pdata; const struct mfd_cell *sec_devs; struct sec_pmic_dev *sec_pmic; unsigned long device_type; @@ -349,22 +330,19 @@ 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 = sec_i2c_get_driver_data(i2c, id); - - if (sec_pmic->dev->of_node) { - 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; - } - if (pdata) { - sec_pmic->device_type = pdata->device_type; - sec_pmic->irq_base = pdata->irq_base; - sec_pmic->wakeup = pdata->wakeup; - sec_pmic->pdata = pdata; + 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->irq_base = pdata->irq_base; + sec_pmic->wakeup = pdata->wakeup; + sec_pmic->pdata = pdata; switch (sec_pmic->device_type) { case S2MPA01: @@ -404,7 +382,7 @@ static int sec_pmic_probe(struct i2c_client *i2c, return ret; } - if (pdata && pdata->cfg_pmic_irq) + if (pdata->cfg_pmic_irq) pdata->cfg_pmic_irq(); sec_irq_init(sec_pmic); @@ -529,21 +507,14 @@ static int sec_pmic_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume); -static const struct i2c_device_id sec_pmic_id[] = { - { "sec_pmic", 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sec_pmic_id); - static struct i2c_driver sec_pmic_driver = { .driver = { .name = "sec_pmic", .pm = &sec_pmic_pm_ops, - .of_match_table = of_match_ptr(sec_dt_match), + .of_match_table = sec_dt_match, }, .probe = sec_pmic_probe, .shutdown = sec_pmic_shutdown, - .id_table = sec_pmic_id, }; module_i2c_driver(sec_pmic_driver); From patchwork Wed May 26 12:47:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281543 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 B1A1CC47088 for ; Wed, 26 May 2021 12:50:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94D946113D for ; Wed, 26 May 2021 12:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234294AbhEZMwB (ORCPT ); Wed, 26 May 2021 08:52:01 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56923 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234907AbhEZMt0 (ORCPT ); Wed, 26 May 2021 08:49:26 -0400 Received: from mail-vs1-f72.google.com ([209.85.217.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsx0-00010e-2Z for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:54 +0000 Received: by mail-vs1-f72.google.com with SMTP id g13-20020a0561020ccdb029023fe9ce9042so197607vst.3 for ; Wed, 26 May 2021 05:47:54 -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=96zqy8TyhAD+JhYW/P5FQPokvQlZGIGEa/sS9Ij98mI=; b=EfD7xKdBIKyF1wp3H1P52tOOuWOuqJxgpdNW/OhzPa1AixJkAqmvwyN3WaK83Dl1TV nZaPrqllQVUZGQ7MVHyaECBuGpGVyFDBqT1XLsK559qzXMI6/8vDISEzWEEKFbab5Jrp 8ifDApxZfQBwU9tdIyWZRCJWb25uAfKePk3LauMLGt/z3oN2IF2UV/kMgaxUB18FyeM0 oQU/FYGzC05g0AYsvOcDO8Cf4WGBeCMrqCx4pYL3Bg4yAFzIKpCi8MRgAbL271DjMlOa Uzn+o4TvDRqpqr4mErybIcDm9hV4ggPauth9K7GAHrbQhI83vbt+A1SfhF4nlYQnXNrB VtKw== X-Gm-Message-State: AOAM53108fR7LodSJMGDUBWQ4JTEWWxLmlUCnXV13ewJpxF5O89YiVnR NXK8k1mLHY6dATjXIHo8t4z8R1nhwzrjX73TxWeXmAqghUnn/UAPgOo1rRPyBmzDuUuoMRNHUI7 jDjErHZRL34FD9RGRKeKNVc0mZjgslEW5qTAUaCr2N7BqRGUB X-Received: by 2002:a1f:2b14:: with SMTP id r20mr30492916vkr.9.1622033272867; Wed, 26 May 2021 05:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO/rrxMa4qIJIelG7iI0H1rXGneLYwFOt4TREWN2jBRdXeBJv8coCByPtPILPPl70OO9SmeA== X-Received: by 2002:a1f:2b14:: with SMTP id r20mr30492869vkr.9.1622033272302; Wed, 26 May 2021 05:47:52 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:51 -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 09/13] mfd: sec: Remove unused cfg_pmic_irq in platform data Date: Wed, 26 May 2021 08:47:07 -0400 Message-Id: <20210526124711.33223-10-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-samsung-soc@vger.kernel.org The 'cfg_pmic_irq' field of platform data structure is not used and can be safely dropped. Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/sec-core.c | 3 --- include/linux/mfd/samsung/core.h | 1 - 2 files changed, 4 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index c61c1fc62165..653d02b98d53 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -382,9 +382,6 @@ static int sec_pmic_probe(struct i2c_client *i2c, return ret; } - if (pdata->cfg_pmic_irq) - pdata->cfg_pmic_irq(); - sec_irq_init(sec_pmic); pm_runtime_set_active(sec_pmic->dev); diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index f1631a39acfc..68afc2b97a41 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -85,7 +85,6 @@ struct sec_platform_data { int num_regulators; int irq_base; - int (*cfg_pmic_irq)(void); bool wakeup; bool buck_voltage_lock; 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: 12281551 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 B3951C47082 for ; Wed, 26 May 2021 12:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B7E3613DC for ; Wed, 26 May 2021 12:50:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232661AbhEZMwY (ORCPT ); Wed, 26 May 2021 08:52:24 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56937 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234920AbhEZMt2 (ORCPT ); Wed, 26 May 2021 08:49:28 -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 1llsx2-00011g-10 for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:56 +0000 Received: by mail-ua1-f72.google.com with SMTP id o4-20020ab037640000b0290218107a4549so705273uat.14 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=YXa3LFwZJrSR6oSc1snWF9NpOeELEuRSnmYdaqnVOp2ZCcpYEESBRV0nBkePMixRGB euM1Vp4hozRYQZZC2jbv05JJGbyo/tCAqutENmDo9pr3TNlJjzmKsntBY2+AVlerKTNN InYtR5UDzJSeDj6nv7ikFEC5CX5IInMQ9019sg4A1vBPQ3+zqdq7Ge8mAJ0DpwvnIXZ8 yaDR5IFtvVf/g3fb1Wk832VZq03ZUWavCr6KIsi53zcOvte5PS2ZW9M6H9mqs3hqwD79 B5ejb9Tgi4cL4MynvlAx1/UY9Bnwqs//PGZD79/YG+BjIz/JUL1qFzMP3/tTxd9qb7Tf bJKA== X-Gm-Message-State: AOAM533qQfUJSXlIWYNubjftIOnqxV+7xrY1ba0Rgne7BrbjujzJkwKX U3BOabv+nDA3SDFLj1ArTD50cWTc2ZwpAYh4OtXiinamo88wAweLc04uo5ChWqWT4Ob5p+Ko/0m +H9YQPDZJ4+ttInX5Y6EFQ8UOSEa9vQ8l0v4ljXACv0VPbEtk X-Received: by 2002:a67:f303:: with SMTP id p3mr13195177vsf.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-samsung-soc@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: 12281549 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 84C6DC4708A 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 67D63613E6 for ; Wed, 26 May 2021 12:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234329AbhEZMwQ (ORCPT ); Wed, 26 May 2021 08:52:16 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56947 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234936AbhEZMte (ORCPT ); Wed, 26 May 2021 08:49:34 -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 1llsx7-00012r-C2 for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:48:01 +0000 Received: by mail-ua1-f69.google.com with SMTP id j17-20020ab018510000b029020db76022bbso705363uag.12 for ; Wed, 26 May 2021 05:48:01 -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=QOcd4V1NKhz9mKNNE+FuDlnL3hdyPZJ+otOdX1FpBU++CuSrnneYPCtm+84alIpSyN onnkJYdw8PmBdnf1d6Xanv2E1c+bcUOlIUU+c7M/aL8Cu+NP+tCYO2lr0VGFdjo0tx8f 5KbF7McOR7Z3asBXgCf+JlJkfZWnBcYV5p/590PigW8yLVLdXxMLd8htVBIhlKkFFGRy oKTm8nMDms1vMigdGBFhkN5AeVmvsmILIvwq6jXZ5hsmXYEUh9TklB7krj6FM+Akau4W WnGP1kapccKLfA6iA/YAq5/N7hDKQHsrhjoGTKuJ2SjmTqRsjUsjKWjCbaq7hwwUC9cy g5MA== X-Gm-Message-State: AOAM532aHbUQtU7TsyQWLw5TZuZLGB8kHwPMthEYCNafMponOojv4EyF TZxI6nknBvi6+2tpqZl6eqz410r/k+dec9iOU2VKIqbJI2BUsebNSvMf4Bjyj/h0lO+hpwyukVG un/EsbrV5fI25jNMLZ6qU4yqbZnkgJOWa3OqVIlEV8nKrugqi X-Received: by 2002:a05:6102:34d:: with SMTP id e13mr31166291vsa.31.1622033278872; 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-samsung-soc@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:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281547 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 9EE71C47082 for ; Wed, 26 May 2021 12:50:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 834866113D for ; Wed, 26 May 2021 12:50:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234282AbhEZMwN (ORCPT ); Wed, 26 May 2021 08:52:13 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56959 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234942AbhEZMtf (ORCPT ); Wed, 26 May 2021 08:49:35 -0400 Received: from mail-ua1-f70.google.com ([209.85.222.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsx9-00013y-GQ for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:48:03 +0000 Received: by mail-ua1-f70.google.com with SMTP id o7-20020ab01e870000b029020d37e3e144so732677uak.1 for ; Wed, 26 May 2021 05:48:03 -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=3Ff7mSFDiPKWIRPLH13ytxRgyCEPx2Ey1Zs19kp0hAg=; b=n7LIG1ax55EBrIGWeSuldgfzBjDmg2HaEmzlsceYaFQCvgYTteT7M6SidfR9uMz7kQ gN3n19vYbqcxNKFr8B33COhWT2a+XAPmR0E9FnTarQX7ocwTkYnQkDzNYNyPQNyxr6U6 NpKHnU32aozUhUAHNPGFnq6522+DWFCTGi5GJsNMGwI+5H051dlc6HAIG2KgmrAVeGO2 ccVD9j5hkk0z7qUDPS6qgej4bYpbbnEVxSUA/eP+jfntfkoypewOVZ5srDxteHUUIK8B OyFvuSGC1C5ITE2XAyjS/ro+MtR8uCFYLCd55hX5lUranfwRtehx8d0U9JMIdYIoylBm 1GZQ== X-Gm-Message-State: AOAM530PpeKYiysylyMtBDO75FZ5Or3cHR3qwQkCJvfqGZWuW5sg8Xyr zVCReku2KGk0D8ZTGkdffxKKIXWKPhT4B3zsAn/AgeMuu59hSurCtzgtK7birayrr8Yu3ZT1PGN SIXZt10DWABDalOhq+u4fHHsGhpH7cKiEY3V0qXuI2hjQQKbl X-Received: by 2002:a67:efda:: with SMTP id s26mr30788862vsp.8.1622033282595; Wed, 26 May 2021 05:48:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvzp8HuLrUUCnUNiZlA3le4xYeTGQur5HspC6co1WVkd+XDr3puQBLsVJFCIEz3BujO0hIwg== X-Received: by 2002:a67:efda:: with SMTP id s26mr30788839vsp.8.1622033282400; Wed, 26 May 2021 05:48:02 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:59 -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 12/13] mfd: sec: Enable wakeup from suspend via devicetree property Date: Wed, 26 May 2021 08:47:10 -0400 Message-Id: <20210526124711.33223-13-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-samsung-soc@vger.kernel.org Set device wakeup capability from devicetree property (done by drivers core), instead of always setting it to 0 (because value in platform data is not assigned). This should not have visible effect on actual resuming from suspend because the child device - S5M RTC driver - is responsible for waking up and sets device wakeup unconditionally. Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/sec-core.c | 8 -------- include/linux/mfd/samsung/core.h | 3 --- 2 files changed, 11 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index a9d4fbc51997..1fb29c45f5cf 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -298,12 +298,6 @@ sec_pmic_i2c_parse_dt_pdata(struct device *dev) if (!pd) return ERR_PTR(-ENOMEM); - /* - * ToDo: the 'wakeup' member in the platform data is more of a linux - * specfic information. Hence, there is no binding for that yet and - * not parsed here. - */ - pd->manual_poweroff = of_property_read_bool(dev->of_node, "samsung,s2mps11-acokb-ground"); pd->disable_wrstbi = of_property_read_bool(dev->of_node, @@ -337,7 +331,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->wakeup = pdata->wakeup; sec_pmic->pdata = pdata; switch (sec_pmic->device_type) { @@ -429,7 +422,6 @@ static int sec_pmic_probe(struct i2c_client *i2c, if (ret) return ret; - device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup); sec_pmic_configure(sec_pmic); sec_pmic_dump_rev(sec_pmic); diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 9864f13b7814..b0d049a56d16 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -69,8 +69,6 @@ struct sec_pmic_dev { unsigned long device_type; int irq; struct regmap_irq_chip_data *irq_data; - - bool wakeup; }; int sec_irq_init(struct sec_pmic_dev *sec_pmic); @@ -82,7 +80,6 @@ struct sec_platform_data { struct sec_opmode_data *opmode; int num_regulators; - bool wakeup; bool buck_voltage_lock; int buck_gpios[3]; 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: 12281545 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 D4A36C47088 for ; Wed, 26 May 2021 12:50:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B46606113D for ; Wed, 26 May 2021 12:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233613AbhEZMwM (ORCPT ); Wed, 26 May 2021 08:52:12 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56968 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234951AbhEZMth (ORCPT ); Wed, 26 May 2021 08:49:37 -0400 Received: from mail-vs1-f69.google.com ([209.85.217.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsxB-00014i-MR for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:48:05 +0000 Received: by mail-vs1-f69.google.com with SMTP id g13-20020a0561020ccdb029023fe9ce9042so197759vst.3 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=Ln9PZ+0FUxEsnixKvxSFj7vSHgYVvc+urEmABprVN+lGddvcZ6AqWqHajQjSQnRK9U sS80IVxw9CTlwtCgH4ByStoYABh3D94IHr/7io7b6oor6YVEkSkTImW+vwprMXa5mwML w6vZ350m21O8RyaXGRZLF+Z2sQz9UVfsn9waAkdfgeqIvX7MFkUbFUsktxsXjjcVGqmK uvIGlDXODxpUpAeepOqv2boNfy9Vu6uemqb9oYwVYqYRkWsK04edn24YXCJ8RZUH0xKW /e4RIZXOjCEx0FA9t6Z6q+4wvdB7tCyFZnLNi+mlzhOnl4IpO5ntaFEGOcXXpqcESloA dBfQ== X-Gm-Message-State: AOAM530FSPSf4WFzLSQSc7VCE1M5e2gJgVuxvhciQRav9/mbToiWsYew Tr0LoFz4UIt+UexiLzqJl0Bx8cbRcxNC+LNJnA85m31XhGynr7LKubVQRN/86Ho9hRIwKD14SP+ bmsI7Rn7gh29Wz03vPfTLNtZlH75+yNCyF6f7smtoRpVl6jI9 X-Received: by 2002:a67:ec4f:: with SMTP id z15mr29705038vso.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-samsung-soc@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;