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: 425576 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 D45EDC433B4 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 75A36613B4 for ; Tue, 20 Apr 2021 11:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231561AbhDTLkG (ORCPT ); Tue, 20 Apr 2021 07:40:06 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39084 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231709AbhDTLkF (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-0005So-MZ for linux-samsung-soc@vger.kernel.org; Tue, 20 Apr 2021 11:39:33 +0000 Received: by mail-ed1-f69.google.com with SMTP id cz7-20020a0564021ca7b02903853d41d8adso3658032edb.17 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=Agl0otRpZvtBmcB8CsjMg97WY/CAr4Ezw0z0csA2V65OfPGJPK5sQ74oba9YkLJc2Q D7LPjALJlGXu3IsyZkW4YkFoSP6Uzs4jJIbXWgVwCFO/E2FtGurGizo4QkTDBJ5wp455 lnXLkBJkuz+1O290kHBM/KTj5uHo2lof1nl7kTOwD+hYooya+I0qZKOu4JcqDbswbq97 dD1zGIbiIrgjHUSLqw8gPfMbQ20pQQaD4bluVibjtf75ILf9Jy/vsNy/TpvTR/XBFpQX OdXUCewe4GHMNkQODXSjVaih1Wtaji6CsRNGYthDRI8kd9J3tvLM3qP+k3pdVG7K4Za7 CiyQ== X-Gm-Message-State: AOAM533VEF6t2VXAGHRO19QI7rOUvx+zfxy1m1qZgisenxXvPcnDr2Yp kvIYa8N/A3G+nXUlXHcs9qdB/HVnOSYHaHW7/S25w7BbEeXDE5ajA0Qjp5QZZ1Q1upaFdSSJUCz lC+LQz3/J/8zikugW5lXBNnJ31QY17XcoQVnAepLnAz5OHsy5 X-Received: by 2002:a05:6402:3591:: with SMTP id y17mr9694321edc.67.1618918773289; 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-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 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: 424885 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 88301C43461 for ; Tue, 20 Apr 2021 11:39:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EE70613AB for ; Tue, 20 Apr 2021 11:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231871AbhDTLkH (ORCPT ); Tue, 20 Apr 2021 07:40:07 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39089 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230290AbhDTLkG (ORCPT ); Tue, 20 Apr 2021 07:40:06 -0400 Received: from mail-ed1-f72.google.com ([209.85.208.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lYoj8-0005TP-N1 for linux-samsung-soc@vger.kernel.org; Tue, 20 Apr 2021 11:39:34 +0000 Received: by mail-ed1-f72.google.com with SMTP id f1-20020a0564021941b02903850806bb32so7015938edz.9 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=fxyOzfrkUGeuokgU/8swWa3JFe/U15BZwuhk3JTkEiW1xapMSEtqUaK8pRh079yzXx xPhki+sHAo/xp6XTjYyOAddhcC+aZ0ibgJRkS/SliyZVDBMnnkn2n/mAECKhT2/sfItb oRFwzUkzvlUOkNXvPgjyrFOa7vXnDY8fUzMqhWkcl7U6Axi9qEAzdPnaYzHO7Q7YC+LM Z4KHT3JM5t/c4g8HJhjhSlmtqsn5m9MgbhFJOPU3hyekw3vNTmoOe2Yw3R9Jh3w7wa0v zsjl7DXti44OP9nSiOUzoXrxgyPOEjqi/czy4EBLm6my96mlQgUMDrwr8nt2DAJgIAtO 4yVA== X-Gm-Message-State: AOAM530RQ0sdJNvujJ5uWRyzCQ4Nk8eTY9jufGfZ0LfGiBELYe4L0npt E8eiKC/4L5LK3WVEoBGz5MvFdMs3aKYZ7IRbb3DQsWzZhs8CvyohyRdXQf29YkteXrDxop6Jcst Z3Z/va3H4GoVR7VE32eFOhR2ujleTQ6ljlrKN4gzf0aQ0CQgX X-Received: by 2002:a50:fe01:: with SMTP id f1mr32499229edt.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-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 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: 425575 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 E6C3BC433B4 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 5E2E6613AB for ; Tue, 20 Apr 2021 11:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbhDTLkJ (ORCPT ); Tue, 20 Apr 2021 07:40:09 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39106 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230290AbhDTLkI (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 1lYoj9-0005UA-VI for linux-samsung-soc@vger.kernel.org; Tue, 20 Apr 2021 11:39:36 +0000 Received: by mail-ed1-f70.google.com with SMTP id v5-20020a0564023485b029037ff13253bcso12943246edc.3 for ; Tue, 20 Apr 2021 04:39:35 -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=PbsX6lzlVlocfNKVaHtqack0L/ZOjm0XjsNl++GvKF1DCq7n2vgoeSsNvWvp9LfqeN 9SIOe30sIEUz/Voo5S55tff6wSho/WV75LAW8uNK0UKHqfDTCGcNDxQ0zC3xYDBWzsL1 Y1Fz0LiljHDjsbYh/CPge/1zbw3W9ctlxSvDoZWHGNM9Syhk5r7b49CPYBdrO4qroyND 4Itq7gAbp6jhdEfcTXhq1DSDBKGj9ADRaBPmRYJIWYFTRbda6EQAbCZKAW3gVIGFk/mB oBWO+Q8yXqltaiJWzUo56cuAgiwfaXPYjclOtq7dq6MzJJd6Vz9lvVlq/mqsyjSlCUH3 Sx4w== X-Gm-Message-State: AOAM533RI4Cy/COw+qfvSNMsvWygRx4Po0RS8UeYniTGj1PkCnNIUZAj 5wlEF/4XiwVdIb/B7MmI23HMI/4lkPgfunWHyrxytffUbJWA2C2M0RIkbBlWZ5cATdhPoCTkbKU 0/xLD1m4KwbTNi7a7Fi+CtqHNQTHMHneGMKBP+UJye82a51LE X-Received: by 2002:aa7:c9cb:: with SMTP id i11mr6030784edt.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-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 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: 424884 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 0AD8DC433B4 for ; Tue, 20 Apr 2021 11:39:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9CE1613B4 for ; Tue, 20 Apr 2021 11:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232006AbhDTLkM (ORCPT ); Tue, 20 Apr 2021 07:40:12 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39124 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231945AbhDTLkJ (ORCPT ); Tue, 20 Apr 2021 07:40:09 -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 1lYojB-0005VD-Mj for linux-samsung-soc@vger.kernel.org; Tue, 20 Apr 2021 11:39:37 +0000 Received: by mail-ed1-f71.google.com with SMTP id bf25-20020a0564021a59b0290385169cebf8so5561207edb.8 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=fUrxfKRZ0zEyDXtG6tjBG2FvTpgu9v3BrXqpq25pnRXm+VojNo7nzoh6rtG6VcZN3U PIo5r2MSY241KsC3OzZDx9l1SDdwEsk96WnUedV7Ol0ITVICqmtXNSezc+Znp5hKerk9 kVAww72TgfZrOUICSctcbde/EYp44k6kX2E0h3nnnxp0EDs7uRaA6kHIe0uLSWs/8osQ bw+W8RFcus2b/JIP3oG6A0RUw+p0iVDrwTMR7YIa7Mn2Hjl6lqDwan/mo32ZrPKc3Ezn 2aLUC2vxy5y2hnzxFC2q7Dc5ja+EWL+bdSFnJgS6iI/ucoA4F53kAGGjgZHNXHl/38yb weVQ== X-Gm-Message-State: AOAM532808OwPts372Mv71S4OvCQt4m7vcj3ze7h3j1h2EdujZ4Z30Gu gflKypCHtR7QUFnq+5oKVtQgq7tkaznTO5GDMok2j7nBt5uaadYD2GUpywZ75VJ1BT8auQ4VF+b 0+QUPnDPcezYV1+p80IJlNtkmfrgxmHJj8duMPZ6OcrurcC3P X-Received: by 2002:aa7:da15:: with SMTP id r21mr31299677eds.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-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 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: 425574 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 61578C43460 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 2AAA0613AB for ; Tue, 20 Apr 2021 11:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232030AbhDTLkO (ORCPT ); Tue, 20 Apr 2021 07:40:14 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39129 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbhDTLkK (ORCPT ); Tue, 20 Apr 2021 07:40:10 -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 1lYojC-0005Vq-C6 for linux-samsung-soc@vger.kernel.org; Tue, 20 Apr 2021 11:39:38 +0000 Received: by mail-ej1-f72.google.com with SMTP id n10-20020a1709061d0ab029037caa96b8c5so4687687ejh.23 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=EbVHhYcsMRZmvL2uHad1/MZJ89SN7fpZ4ZWg5ev17RAd5K57w8NwxVHjlrkgK27JC+ ZWhgesMnN+aLKn+hhLqgJp7sC817wNJLrtBqqZ1RVxDmEo5z8Ki0O83EbpXKG4xxx8c/ ZabHS2w6S4e/IdRuMa7PyjLruF0yDwsc+TXpiJv1mV9jGJeA/42Ho/OPzLOGTG75GeNc 3slvhuMaBuMQFAA5TwYfngybMa3mOoJhvvSQch3vHQ2A+K2PgsqAZ7woSDAzwjMG06dQ v3gkNPsHj/Ehq6kwCTFcy0CWW5P4dUPEjui6fSje5nYkSbB7Trrj1OlDH9Mhw8Y2PdcV tF8Q== X-Gm-Message-State: AOAM530ZZw+cVLoz22uSe7G7Hd1mVPYIbD1BPE7rkovpwt9ZeHjBhUnA +NWlpzhLuG09wKSeUaG8pHxRmsH2q8b94Q99AgodNwuGXdCwfVTEs33yOBEjM4r6RkvImk/nvUp IR4sYorn4LRIqmIexL7LVZpGbqMfsgP5GzEGanYdpsH/V3eCG X-Received: by 2002:a05:6402:3ce:: with SMTP id t14mr15486437edw.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-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 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: 424883 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 DC911C433B4 for ; Tue, 20 Apr 2021 11:39:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7277613AB for ; Tue, 20 Apr 2021 11:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbhDTLkQ (ORCPT ); Tue, 20 Apr 2021 07:40:16 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39149 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231994AbhDTLkM (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-0005Wp-Ri for linux-samsung-soc@vger.kernel.org; Tue, 20 Apr 2021 11:39:40 +0000 Received: by mail-ed1-f70.google.com with SMTP id y10-20020a50f1ca0000b0290382d654f75eso12947618edl.1 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=kr6w3eLGWShhyJTaZfD2afi2438zXRyZpbzAHctgpRtn0wv4KWqzafHXIeNZGQL3NU JTLdk0Bt5SNt/dDF+vr5q1+d7hXMD5+/678Sj/7P6iBHOmOqHZ2B0nziC4gv65ZRphFC cvqk+yAiBhf1bfgItZehEmXdaZU8o9U6UcDqYXPmgkvoYZvTvpGluUPoA0zY1VovPTP7 b5UUO+oi4X/KYXYCY6cSHB5CnY/X/P72TOOtdw35J3PymZYhiifTjri9jkHl18DxCgv5 h33zsUjqyB1hHZwuvRH3Hj6ZhTIRX3mveuPtOswfNLw4uIe0wsaB+yQQKnv76QveCh7A LsJw== X-Gm-Message-State: AOAM530enGUmgaVJKDVkebook0dq99fkdYGc4+Vj+rKgdd9CIsMnHkuf RJB2Kb7dO00LeWwkNr2fOvnE1lde5QNTEAkbuprrhsb41v3PoMc+N/KkO4dHwMJLN/n3L74ooYd qR9zpCafj19AFoMtqs2AouDQSbiQ8BUz7znuHAZoEpDpl6DJK X-Received: by 2002:a17:906:a20c:: with SMTP id r12mr26633991ejy.554.1618918779365; 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-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 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: 425573 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 33243C43470 for ; Tue, 20 Apr 2021 11:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3F14613C1 for ; Tue, 20 Apr 2021 11:39:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232020AbhDTLkT (ORCPT ); Tue, 20 Apr 2021 07:40:19 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39154 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232016AbhDTLkN (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-0005Xc-OW for linux-samsung-soc@vger.kernel.org; Tue, 20 Apr 2021 11:39:40 +0000 Received: by mail-ed1-f71.google.com with SMTP id d2-20020aa7d6820000b0290384ee872881so8874007edr.10 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=G0cqpfCKOXDsmhgzrO01fjc1FY98j9CtgRLaMhZwqX+pGsEqv1HHt/dSZllyBQecdL ysVdMo1WKSGSTu/g0NEmA0qwnpDEby5tqmZB+sMa9urhkx2nOVskoEbX0H94zuuacdtn EeF3OB3qsqkO4NHHoa3ekxaji11JZ5k9z9K9UJ7/6a2M4T4QMSgO54wor84K+ckvd84x tHQqDOnMVXN5dHQOTI0Cpb6r4gTg4Yij/ULA8JwPGmwp+ackF4O007EIFUnAsGL9tp49 K3if/i15W4rGI4Fsdy1XybYgxRXeXNJ6/RCr/KpkQPsRbPQbe74aEU3jq1Kb0Gdy07qQ 8B2A== X-Gm-Message-State: AOAM5309YojnaP8iMusNmSGn0d18/fOSYwWDY2Zn4SDIAzNwQbCKIgqx zMoMuoDVo6WVgF561URPclTFZqH/8pWbVqFckkfM9Lh/Ms7UrLUURvzcPC3DiFZ4u6W+7oK4Fq0 UvNFzypwfhQ2rBZ3r4M9a6y6xMkLuFaMpkmiElVhrnA8UA56w X-Received: by 2002:a17:906:b85a:: with SMTP id ga26mr27062866ejb.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-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 *