From patchwork Tue Apr 20 11:39:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12213851 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 CFDF3C433ED for ; Tue, 20 Apr 2021 11:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98C0A613C5 for ; Tue, 20 Apr 2021 11:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231718AbhDTLkG (ORCPT ); Tue, 20 Apr 2021 07:40:06 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39078 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231561AbhDTLkF (ORCPT ); Tue, 20 Apr 2021 07:40:05 -0400 Received: from mail-ed1-f69.google.com ([209.85.208.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYoj7-0005Sh-He for linux-omap@vger.kernel.org; Tue, 20 Apr 2021 11:39:33 +0000 Received: by mail-ed1-f69.google.com with SMTP id f9-20020a50fe090000b02903839889635cso10981623edt.14 for ; Tue, 20 Apr 2021 04:39:33 -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:mime-version :content-transfer-encoding; bh=q90BO6jGToShK7OtE3+O0ipoJJd5f8g5lHfCYVt8P0g=; b=dfgwR++Jex6gN2UhxNS9/Q2lvCyPTc9EbaStHNZJnCbAKBcPHq3uo9U2Sy8WpQVa71 wItluMk7h5e527I+e8Uo98ncumuQNgrZpTcL/sAzKDTKPuQ61+icRP8rZrdv1YT5XNm3 8NJraNmesL1XXGlTdvAHwU3XBGA+kxriwmkXe/SwGTsfgTgQo8AUl9B1b1vp8jQUh5Ye LtoRZHSkoXpo7zQdMeK45ksjManG1vmxOpKkTdxDD8cEoW7HurWesBXc0kHPtY8njssi d0htdpsc4/+43P52+XsVgBja9OpLwxEpnVmNF2TuPjDmiJE23F6iY9+/VRCPith3Ks7E EItw== X-Gm-Message-State: AOAM533+Rvnxf/4v7mE6FJRQhv0GFIzQKsoikR8hwuhQDZBO5nlx6MSQ plHDEy7bVhng9Lun1JYKRnFx3Zaim8BWHLSOqK3e8UfkVmepcU2LkY0mzWDw26hfD9Tqe7k0Lr3 7ClLP0+M8cFykG7fQbTGiueL6fD8evL8ubq/0www= X-Received: by 2002:a05:6402:3591:: with SMTP id y17mr9694318edc.67.1618918773288; Tue, 20 Apr 2021 04:39:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCLCtp1s6fwTCslFHZbIHpbby+AF9jKEcIYP26e31mN/27ZAbOVO9O6Pn3Wxa5EUsrnfGQ7Q== X-Received: by 2002:a05:6402:3591:: with SMTP id y17mr9694307edc.67.1618918773112; Tue, 20 Apr 2021 04:39:33 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-180-75.adslplus.ch. [188.155.180.75]) by smtp.gmail.com with ESMTPSA id bw26sm10109007ejb.119.2021.04.20.04.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 04:39:32 -0700 (PDT) From: Krzysztof Kozlowski To: Support Opensource , Lee Jones , 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 , Sylwester Nawrocki Subject: [PATCH v2 1/7] mfd: max8997: Simplify getting of_device_id match data Date: Tue, 20 Apr 2021 13:39:23 +0200 Message-Id: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 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/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 Tue Apr 20 11:39:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12213853 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 E92C5C43470 for ; Tue, 20 Apr 2021 11:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC063613D1 for ; Tue, 20 Apr 2021 11:39:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231918AbhDTLkI (ORCPT ); Tue, 20 Apr 2021 07:40:08 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39091 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231817AbhDTLkH (ORCPT ); Tue, 20 Apr 2021 07:40:07 -0400 Received: from mail-ej1-f72.google.com ([209.85.218.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYoj8-0005TT-Oh for linux-omap@vger.kernel.org; Tue, 20 Apr 2021 11:39:34 +0000 Received: by mail-ej1-f72.google.com with SMTP id j25-20020a1709060519b029037cb8ca241aso4647338eja.19 for ; Tue, 20 Apr 2021 04:39:34 -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=wuB2/tI9xcQwhhNMwxEVaEgHMJT+b83uq8pd/UhDHWg=; b=TXyOK3E6DdcVThpb7w1np1hZR8jVO0UryN7G2dWhp2DuVaPx4y3za9lXWrIUBWItqH WEkK4mCqpj2TcGMETmbDgbefSd6+nQuargAtEBovECBFh3etCqndjx9XNpdv6bic3xeQ nKKEWCtb6hBKi6RTIAPJlc9LlnY0sH4BMIHspi/ONCh2alS3Zc9ZTZC5Yz1cv2/XyS/M 3ldijeBJ8GKIBuSo/h5gjkyXyzpBbTcGxlkx2MX8HZINzUOaJvhoLGKesz3BIDO91p6S 9R9QZuBvhlADsEEB3/xzHfpZpuWKm2p/YhhNgnwLnR1TeQmilrxCRI0NgEX9IfDJIGGM D+Jw== X-Gm-Message-State: AOAM533CtiqSse3LICo145YG65MCgWxTN+l0Ne2YAogTTHGD+dNsql2+ nWG3wOHbRzXgTX371GapRyd8cloIj2KlpqJhVidTmXKBcHcrjVT7ZCx31KkzEH5cqu9y08R4uaj XyiTGyFZnoFPG/0gQWGZHPTWV0TeRnbcONuK/4HM= X-Received: by 2002:a50:fe01:: with SMTP id f1mr32499234edt.272.1618918774490; Tue, 20 Apr 2021 04:39:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7Xuk25grH3NsIgvMGGGwnXop0ZMYNrJctTBWfujHm1kJVpv/I1QXZELdTEgMAyJL7wTYErA== X-Received: by 2002:a50:fe01:: with SMTP id f1mr32499223edt.272.1618918774374; Tue, 20 Apr 2021 04:39:34 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-180-75.adslplus.ch. [188.155.180.75]) by smtp.gmail.com with ESMTPSA id bw26sm10109007ejb.119.2021.04.20.04.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 04:39:34 -0700 (PDT) From: Krzysztof Kozlowski To: Support Opensource , Lee Jones , 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 , Sylwester Nawrocki Subject: [PATCH v2 2/7] mfd: max8998: Simplify getting of_device_id match data Date: Tue, 20 Apr 2021 13:39:24 +0200 Message-Id: <20210420113929.278082-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> References: <20210420113929.278082-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 Tue Apr 20 11:39:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12213855 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 E5C78C433ED for ; Tue, 20 Apr 2021 11:39:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAD5C613C2 for ; Tue, 20 Apr 2021 11:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231954AbhDTLkJ (ORCPT ); Tue, 20 Apr 2021 07:40:09 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39112 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbhDTLkI (ORCPT ); Tue, 20 Apr 2021 07:40:08 -0400 Received: from mail-ed1-f70.google.com ([209.85.208.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYojA-0005UN-BY for linux-omap@vger.kernel.org; Tue, 20 Apr 2021 11:39:36 +0000 Received: by mail-ed1-f70.google.com with SMTP id z3-20020a05640240c3b029037fb0c2bd3bso13054465edb.23 for ; Tue, 20 Apr 2021 04:39:36 -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=1QRQo+xpUYHPCxTbJPvKb59/XsQMOAX0KEXbrpjY1cc=; b=XFfC0HKtbqqv23s1LNoKdwSs42kO2QeDTfIpfTFu7Mrx36qdaZeAowlLLFkkrFtH9Y ZmxIGpCY0oy5/2DZevhJhn92VRk6rmdBu7dFIBeI430nhLSCHoSC8A/8az8EsghONGmR JTAX8b0U9Y62R+gGbWJFmZ0tAatH/DTmITNpnc06KewsRBtpTW8xsU+memhRqYU69vS+ EznvH0YDEAJm0EA6DN2LSFidwzB9n7c7Fp47Stzm8uSghlr8PGNTVIbackEy9fnQCAQZ I7ufyv+z59/UZI1gJyHQymmyJtVusJj+ZDSLKJSOlpvoaI/wAjn2RC0ANSCRDTyiwmeY kFPg== X-Gm-Message-State: AOAM532AYyMGyuXbzk0CtWEN+NOrN/34vGMmIyW5fbRUnupOZ+/Oo6et NZvQtEQ3JwEIpCjAprtNFay1p45QHKBSdkHfuUvM6/dImSZ8b6m+qz7YL6Tedn+boGBiSBNo9Z3 hUIidOV8vOc79cZPicq5cpkw+8PLREkzE9MgmwWg= X-Received: by 2002:aa7:c9cb:: with SMTP id i11mr6030781edt.331.1618918775748; Tue, 20 Apr 2021 04:39:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxenHfop9KAauFCZtv5V4COrg2sAveJWXuaem0SSGfvEBrhcrropUIwjQVfyJ44In3y9caFVA== X-Received: by 2002:aa7:c9cb:: with SMTP id i11mr6030762edt.331.1618918775613; Tue, 20 Apr 2021 04:39:35 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-180-75.adslplus.ch. [188.155.180.75]) by smtp.gmail.com with ESMTPSA id bw26sm10109007ejb.119.2021.04.20.04.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 04:39:35 -0700 (PDT) From: Krzysztof Kozlowski To: Support Opensource , Lee Jones , 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 , Sylwester Nawrocki , Adam Thomson Subject: [PATCH v2 3/7] mfd: da9052: Simplify getting of_device_id match data Date: Tue, 20 Apr 2021 13:39:25 +0200 Message-Id: <20210420113929.278082-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> References: <20210420113929.278082-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 --- 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 47556d2d9abe..5d8ce8dca3fc 100644 --- a/drivers/mfd/da9052-i2c.c +++ b/drivers/mfd/da9052-i2c.c @@ -154,13 +154,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 Tue Apr 20 11:39:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12213857 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 7FD5EC433ED for ; Tue, 20 Apr 2021 11:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 482FB613D0 for ; Tue, 20 Apr 2021 11:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231920AbhDTLkM (ORCPT ); Tue, 20 Apr 2021 07:40:12 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39115 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231929AbhDTLkJ (ORCPT ); Tue, 20 Apr 2021 07:40:09 -0400 Received: from mail-ej1-f71.google.com ([209.85.218.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYojB-0005Ux-9K for linux-omap@vger.kernel.org; Tue, 20 Apr 2021 11:39:37 +0000 Received: by mail-ej1-f71.google.com with SMTP id x21-20020a1709064bd5b029037c44cb861cso4647986ejv.4 for ; Tue, 20 Apr 2021 04:39:37 -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=z90S5N2Vf8o3affpqAJ/qKsRULU7kNCm7WTR7sGPJFI=; b=mOJqnWKeDq1mN+cN8ZmGSQDZaWO+eUT24vaqUwR0gtrRnl4PVBx5v8NfnJ/Jf487/i EKX8nPPP8vjbksVHu2hE4Jo5oLVq4z+MRDl23DWRemEZwyFXlSjKHa0t0miY/hq8kWh+ wMVQjYMJfZSfWE44FB1vLpGi04E9Ru98yjzB99tPN40/v52WVP2p7RMeQllAMXmYQLKo yuuXHlCPne77hSFi+mXSv84vzWY3MaGhKkr68ftgmZiw+hfSDg4UnkHCTq/hhHs3fhbT 5Vbk+LeuG+SRUyvStbnFR0BmRZJieyNiqBARcY3S7HlMjVtlV+ilhSQw2Ts/OyLOuRIl v1wQ== X-Gm-Message-State: AOAM532qHTClxfAQMozIcamFe6pAvQMOu9Co0mVMPvs08oaCzMV2NGMS 5hGtvzXFS7bBKYU/TygOstGq2521OQAXa7teYXIsYS6yeTjP2w6oG6Igv+k37sRFSob3qInJClg DzeYUUqTqwqBKKZljof1UvhUjOj1GR7NLIgadd2M= X-Received: by 2002:aa7:da15:: with SMTP id r21mr31299680eds.253.1618918777054; Tue, 20 Apr 2021 04:39:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDLe7voWiCNzz20rbTRMwYK/knYegMngT8XRwqFQSN5JSDPctogln3VwQ/zsXtlLbeBhoQVg== X-Received: by 2002:aa7:da15:: with SMTP id r21mr31299662eds.253.1618918776947; Tue, 20 Apr 2021 04:39:36 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-180-75.adslplus.ch. [188.155.180.75]) by smtp.gmail.com with ESMTPSA id bw26sm10109007ejb.119.2021.04.20.04.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 04:39:36 -0700 (PDT) From: Krzysztof Kozlowski To: Support Opensource , Lee Jones , 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 , Sylwester Nawrocki , Adam Thomson Subject: [PATCH v2 4/7] mfd: da9062: Simplify getting of_device_id match data Date: Tue, 20 Apr 2021 13:39:26 +0200 Message-Id: <20210420113929.278082-4-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> References: <20210420113929.278082-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 Tue Apr 20 11:39:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12213859 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 783E1C43461 for ; Tue, 20 Apr 2021 11:39:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 44460613BC for ; Tue, 20 Apr 2021 11:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232019AbhDTLkN (ORCPT ); Tue, 20 Apr 2021 07:40:13 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39133 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231968AbhDTLkK (ORCPT ); Tue, 20 Apr 2021 07:40:10 -0400 Received: from mail-ed1-f70.google.com ([209.85.208.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYojC-0005Vu-CX for linux-omap@vger.kernel.org; Tue, 20 Apr 2021 11:39:38 +0000 Received: by mail-ed1-f70.google.com with SMTP id cz7-20020a0564021ca7b02903853d41d8adso3658120edb.17 for ; Tue, 20 Apr 2021 04:39: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=uA4zMXERcZERRFVtvNG5BrrsNQ88clv/v46eOD0pR5M=; b=KWw1fVM9xzJ6uTnQYpc6YyLQGCfkAuudQ6o949Ou6g6/oer1smJynh8S/YkIRF0aAM nrhhQUvuLXqr3Bi8gSi7/dKjJMrGN7jlxLUVwLsJUDO240gAC5Wfr9Y6XqWKv5GxOuAZ T6650P87PQugRucV/gGke8ZuhWzZwdmbY/1RZtwoK7ZFY6hLDRfygdTeewRbCw7d4/EO RqLyJhzLU8ydxfhqKp/fzFjze4RMYbdxORx7xWDzOCfaMBXychyd5rYR7QVrj9SRwxFL qwPVurnSaEmY1WYIFEb3ZMZid0l9908b34Q4NAcN/g83hfKoKZuDXZaKgbLeLT9zlhLv 2jaA== X-Gm-Message-State: AOAM5327gXIGq3mzn0MRIpm5DIuLp9zO6eBm4/UeAqzBjY2kLsfJuvva yc2+pYe8zWb66VS1H2KkFDwMsWUtZE5d6Hd6lmXwpCt/NluV+TOa1xrNX88kD2qmTjw33pSJ3dt 7VdWn7j7ec4RlVvc5/yWIauO9vXoURPJCZGLrfBQ= X-Received: by 2002:a05:6402:3ce:: with SMTP id t14mr15486433edw.142.1618918778135; Tue, 20 Apr 2021 04:39:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAd4zKG30DBWanjfBjytY6/YSWvfxCxt0tF6VGi/LLUDA2FbF6zidPnO/1qnhDujdnL0Nc+A== X-Received: by 2002:a05:6402:3ce:: with SMTP id t14mr15486421edw.142.1618918778034; Tue, 20 Apr 2021 04:39:38 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-180-75.adslplus.ch. [188.155.180.75]) by smtp.gmail.com with ESMTPSA id bw26sm10109007ejb.119.2021.04.20.04.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 04:39:37 -0700 (PDT) From: Krzysztof Kozlowski To: Support Opensource , Lee Jones , 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 , Sylwester Nawrocki Subject: [PATCH v2 5/7] mfd: sec: Simplify getting of_device_id match data Date: Tue, 20 Apr 2021 13:39:27 +0200 Message-Id: <20210420113929.278082-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> References: <20210420113929.278082-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 Tue Apr 20 11:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12213861 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 04FC1C433ED for ; Tue, 20 Apr 2021 11:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CBC35613B4 for ; Tue, 20 Apr 2021 11:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231968AbhDTLkP (ORCPT ); Tue, 20 Apr 2021 07:40:15 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39148 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231987AbhDTLkM (ORCPT ); Tue, 20 Apr 2021 07:40:12 -0400 Received: from mail-ed1-f70.google.com ([209.85.208.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYojD-0005Wn-QS for linux-omap@vger.kernel.org; Tue, 20 Apr 2021 11:39:40 +0000 Received: by mail-ed1-f70.google.com with SMTP id t11-20020aa7d4cb0000b0290382e868be07so12940970edr.20 for ; Tue, 20 Apr 2021 04:39: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:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nq4Jf1F7QpCUtSWxlU+CaxhBrA9IV/0TddbI2jzDURU=; b=QCdBmOzf5NL9em0Nmc9Kd7b8DSPdkV4vgxg/lRk0sKwpH97RyYUMy4ZqJudPC9B8+n zqsfHEjIzMPBX4aLowqq8WWeWwsF21f5sopErCLFfKTgwDMGyA7FoGrTcjd7w1YW1ccL ATCTGBT1q1kirq12myxj0sAJV+er/+r5Zl/3AfFvrerPoTbIWzVl9KnwXAmfddy9YTOm XgeQOIU0/MpnXGy6Hxl6fOta/n0B/eENjWNIVRr/jE00gTK2IosDJrm7PDL/L1G7gBs1 smXeivdp39etz+8NooeV466QeaHEyq3doMj2Tx81/nLC52+CsV45fTsjp4UHz93C7OlT K7sA== X-Gm-Message-State: AOAM530WYx8qi+eyhtDAioxbqqMZgPpl5SgzjioXHT5UI5yVLvlfJ/TW DAGUQf7q/C6ugmUlvO6abUDRwoUrdODd60pT2wRIo8LYnRYcstvCTvOWT95KCfj5gMYiEOSpY55 ljoeCdXVSAQQWDi/jgpuMvcWPgjH7HvmuDfWowfM= X-Received: by 2002:a17:906:a20c:: with SMTP id r12mr26633994ejy.554.1618918779366; Tue, 20 Apr 2021 04:39:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj66eOrcvi2YX4tMopSyiC5EDZvHf8zPXH8NgNMphzXRuWMeYLO+VDG3ozJ9NT6dLeU7BnNw== X-Received: by 2002:a17:906:a20c:: with SMTP id r12mr26633982ejy.554.1618918779231; Tue, 20 Apr 2021 04:39:39 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-180-75.adslplus.ch. [188.155.180.75]) by smtp.gmail.com with ESMTPSA id bw26sm10109007ejb.119.2021.04.20.04.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 04:39:38 -0700 (PDT) From: Krzysztof Kozlowski To: Support Opensource , Lee Jones , 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 , Sylwester Nawrocki , Charles Keepax Subject: [PATCH v2 6/7] mfd: wm831x: Correct kerneldoc Date: Tue, 20 Apr 2021 13:39:28 +0200 Message-Id: <20210420113929.278082-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> References: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 Tue Apr 20 11:39:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12213863 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 9B55AC433ED for ; Tue, 20 Apr 2021 11:39:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F9BA613AB for ; Tue, 20 Apr 2021 11:39:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232059AbhDTLkU (ORCPT ); Tue, 20 Apr 2021 07:40:20 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39164 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232018AbhDTLkN (ORCPT ); Tue, 20 Apr 2021 07:40:13 -0400 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYojE-0005Xg-U1 for linux-omap@vger.kernel.org; Tue, 20 Apr 2021 11:39:41 +0000 Received: by mail-ed1-f71.google.com with SMTP id cz7-20020a0564021ca7b02903853d41d8adso3658183edb.17 for ; Tue, 20 Apr 2021 04:39:40 -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=xk3WBnA32t2m4Myce9cZ0YQ9ZIjnwr2MU+dccRhDaEQ=; b=ZC+kOvSyhfhsPeOcbHzJ3L/0KDTMIln2y+tqwnNiLADaTdrdGM3qNazUhA9Zc+BGUi PK+XDKXgHMgCF629bfWYR/zMneqgaRL+PsUl4emB8wVfjrfXoQxNWzh00A5Y0bI4X0ZP 776AYFEoL6XlCvVtHxrrZv4YM5KMczCU4i9mkupOqSxTZX1MYUcxmEFBIGkMWik3FWkQ oLLVLcyAo/zFo7uXaI0a8tDNqvppwQ2UE/WBC9eZmW/TQSx/QWFGdwmhgQSgEQ/QnHYQ m8ZkuSP3a3e/ju9/D4HaOybmK0DYilr9vnMGwnEfY/9+rIvvQnVKvl788C/uq8746zRc FFRQ== X-Gm-Message-State: AOAM5330LRWD7x3C4omqxTVKZ63dDe2tIfuaEy/34gkADAzYr3JJlI5P Q59xpuvkLFEOBySmS4WCX4R58Zofp9dDlxkJcqgExpHOlNCtp4i1Ya99mWGbwbVSV+IXGc6DpVQ bjgya3wTbYXt6DTSofGMuPVfjiUCNpicKn0HhJNs= X-Received: by 2002:a17:906:b85a:: with SMTP id ga26mr27062864ejb.366.1618918780484; Tue, 20 Apr 2021 04:39:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJs56MliRWAB0TrKrTN4psbryZ6Ncf4csq/xRSSpnIs0jNai0M7qouKkTw2it1vSiuzy3rzQ== X-Received: by 2002:a17:906:b85a:: with SMTP id ga26mr27062853ejb.366.1618918780368; Tue, 20 Apr 2021 04:39:40 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-180-75.adslplus.ch. [188.155.180.75]) by smtp.gmail.com with ESMTPSA id bw26sm10109007ejb.119.2021.04.20.04.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 04:39:40 -0700 (PDT) From: Krzysztof Kozlowski To: Support Opensource , Lee Jones , 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 , Sylwester Nawrocki Subject: [PATCH v2 7/7] mfd: twl: Correct kerneldoc Date: Tue, 20 Apr 2021 13:39:29 +0200 Message-Id: <20210420113929.278082-7-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> References: <20210420113929.278082-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 *