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: 12281505 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 64AD4C47082 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 47930613D4 for ; Wed, 26 May 2021 12:49:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234097AbhEZMua (ORCPT ); Wed, 26 May 2021 08:50:30 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56852 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234859AbhEZMs4 (ORCPT ); Wed, 26 May 2021 08:48:56 -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 1llswV-0000ue-Sy for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:23 +0000 Received: by mail-ua1-f71.google.com with SMTP id b8-20020ab026c80000b029020f97f38cfcso725566uap.3 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=jv+/UDqHG8M2D7Rt5BoLF9xvgPhYw8rM1FQBDToAJ/86nuRBo3YoxU27jWe5HCIuDw pcbpYMhTWdRJX09GrGmMofQn41f1yM1rEkhqZRTDkdOR/E9mXWBUopefFTp4HeCoaYvf 2EqD2kAWNEcOXgC/cfztnJteF86dnpx+H989v4i0+1Yb/zKQA4UG7rgF0T9IVchfJpda sIo62iEfSkH19Jh8HqAWHPbvGRe3HcxZXZ+Q9sBfDx1m5a+4YjmEEqs5df3Os00PNi6v OQf9hGqCfzw6wSyZyIjuPeWHaxRgma1d15XJqMLAlBsfXJL8YzMuq/fU3PBrTxXspiTo HS+A== X-Gm-Message-State: AOAM5309D+JUg7u6vRqeavMxI2M6rzkmHc+dH331UH588ZSKMAGsS23t 3WSbr4NCt5hpOc6yqyuPDudN/KaGz1Nk6CkcGFDM45bTA7FRTcxe6DpJBgRqpgsILWnF2xKXl5K xevO6HKaHVvTkzd9Y5Sk5iq034EXrH7i9uftUIzg= X-Received: by 2002:a1f:eec6:: with SMTP id m189mr28997972vkh.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-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 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: 12281507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F560C47088 for ; Wed, 26 May 2021 12:49:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E91D4613D4 for ; Wed, 26 May 2021 12:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234818AbhEZMuj (ORCPT ); Wed, 26 May 2021 08:50:39 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56861 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234861AbhEZMs5 (ORCPT ); Wed, 26 May 2021 08:48:57 -0400 Received: from mail-ua1-f71.google.com ([209.85.222.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswX-0000vM-AG for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:25 +0000 Received: by mail-ua1-f71.google.com with SMTP id t19-20020ab021530000b029020bc458f62fso693942ual.20 for ; Wed, 26 May 2021 05:47:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lxlGt7UdLo9WhBrHrUnAMYLEvzBvX/vS3VzoKn9EqgQ=; b=pnux0/Zp/bEOt3oeyit1/4XlGE1TP6Jvys3TMkoJejs2TVbIp9FBOhArAiasdFZh+k g2isPeo8CC/t2xbOnL9ERsXV6b0e1cJkdYPhHaZ15NMuSvBnyiPUtWJ8DxwPTn+tJH5F gqPk3uNO2g1AX4/BD6KTv0ybEVLTE+e+DIXXX5FjcleoU/gOkRkOrfBVeJDTfCRUjbpJ qNGO7FIAd3jlDyy5Myh1WyM2kVKMSCkWdS6QDSLJ6fXmzvYJoudr1I/7f0+uZtGRL/4I wZJVjy7Jy9VMelOVQexe9xMxP/7LOZHsEvywbbyAJycXn/U0cRmzi3eDm5SpHhfbFa0z ijvA== X-Gm-Message-State: AOAM532GbMTBoM/r5ky6SsR7JxYhPeyzr31UlFmp5bhD22E60VWubbvf gQSmR4lHorYvk8iFtbGzgfee3REdbAmujOsZtz/3OZn6Y3pSRipseKtU9v2hhiFCFcKX3/W0jHF FFlEYpGAPecKJPci9Q1GA8zNhRof+9ev6rdF61ZE= X-Received: by 2002:a05:6122:c91:: with SMTP id ba17mr27607460vkb.8.1622033244396; Wed, 26 May 2021 05:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeHUz3scp7cdtBDvx3wZhYQgy/hPyyOLqDEXP9LcACOUFA0w4nitE9VfR17c6NvL1vm1QT3w== X-Received: by 2002:a05:6122:c91:: with SMTP id ba17mr27607437vkb.8.1622033244233; Wed, 26 May 2021 05:47:24 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:23 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 02/13] mfd: max8998: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:00 -0400 Message-Id: <20210526124711.33223-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. There is also no need to wrap it in a check for CONFIG_OF, because dev.of_node will be set only with OF support. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Remove check for CONFIG_OF --- drivers/mfd/max8998.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 785f8e9841b7..0eb15e611b67 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -155,11 +156,8 @@ static struct max8998_platform_data *max8998_i2c_parse_dt_pdata( static inline unsigned long max8998_i2c_get_driver_data(struct i2c_client *i2c, const struct i2c_device_id *id) { - if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { - const struct of_device_id *match; - match = of_match_node(max8998_dt_match, i2c->dev.of_node); - return (unsigned long)match->data; - } + if (i2c->dev.of_node) + return (unsigned long)of_device_get_match_data(&i2c->dev); return id->driver_data; } From patchwork Wed May 26 12:47: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: 12281509 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 DDE0AC47088 for ; Wed, 26 May 2021 12:49:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFACB613F1 for ; Wed, 26 May 2021 12:49:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234797AbhEZMuv (ORCPT ); Wed, 26 May 2021 08:50:51 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56867 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234805AbhEZMs7 (ORCPT ); Wed, 26 May 2021 08:48:59 -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 1llswZ-0000w3-1A for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:27 +0000 Received: by mail-vs1-f69.google.com with SMTP id a11-20020a67d30b0000b02902363051a2cbso190940vsj.18 for ; Wed, 26 May 2021 05:47:26 -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=XDPzi4bEGZJdPsVMDJDC8062ukqB/d7+o485hwsanxuqP8KoeUht5AnuHYR78obbXz fltcxUIOA9NCB8v8ywQAd0xkfwqIFeFIZdeMmE2qvbSutj+HWASIsFiwa+4mhRn7vet8 cOWkJeRTarODvlsTKxshD9FB0ZwqIAdvzcWVae01He9uuWXjm3g1Z/hmcCprXOBBeRsf 474SVPxCyGtfv6kIi6ZHZUJzQ7n8QVmi19oUH385swAzc08eNEu8EV+SNCAF8MEDwDZL Oogm++DIn3OWHThgO7G3ve9CswK4S3bJAfUSPjJVURiJPy2IJq5jD4QUTvVmIt5KgFyQ K8uQ== X-Gm-Message-State: AOAM5309wrk5oFB4yzzM+t6MLjDRa5+mmdapMWp+IDt/JK5OVtbu63AC 0kg6r/Lwik897XG5bveg19DI7CUfBRx6CIZOg8TKiAcPJpkK9pcSvQDMV1jtsHT6H2qMEGJduSa p6ST0tHtnZ8r5f48SrrLiqLb4u1XTsoqk8fQkNbQ= X-Received: by 2002:a1f:a802:: with SMTP id r2mr29795052vke.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-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 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: 12281511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AF92C47082 for ; Wed, 26 May 2021 12:50:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07015613D4 for ; Wed, 26 May 2021 12:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234891AbhEZMvf (ORCPT ); Wed, 26 May 2021 08:51:35 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56878 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234876AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -0400 Received: from mail-ua1-f69.google.com ([209.85.222.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswk-0000xB-PG for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:38 +0000 Received: by mail-ua1-f69.google.com with SMTP id z43-20020a9f372e0000b029020dcb32d820so727395uad.2 for ; Wed, 26 May 2021 05:47:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VIi0UDETJWMz8r22ACVNYPInzss+jr7PKRHzj4F9CjI=; b=DLwAkGJZFVMUo97KsFIZLerLJtjo6WF7jnDDcBntzVAySpQC8nayPjrGQs7XDTLOnI /cTj2/brSzvX4uTsRsrC7f7mxBIFMCjHREmEdN/OXR4U4JDTEFvJT0dNzhAe8sv04buI /ZUonblQx8hG+FQ1R0dy4oEo0bcVSSbbFrLTfaKI+41qpkBQpCdb9tv+hFRMMSHPdZZF V3gUQ7Nm0h9KtVKIiVDNNZ0eeAuxZ9uDqwySVljS4i1v+Om2rKhednXz0sbwlaJKbvZ+ tRVrg/OIjgdktCO/r0coIfHUAwlvC5D2zv2gErFp8SEtCrjSz/zyYU70JoHPs6/FsNKX d2CQ== X-Gm-Message-State: AOAM532Oy6lf60hIwXg2wJVQPO6z28sLVahKxUj9va24u8vDN00gubDu 0s1PwRXLvrZzho9WKFo0hoWirpU5zW3zN/rOA/qxK8jbsmhKZRIGzFcuXYGdsE2egS2B/e8N043 Vgc7YF/z9w0fv2FvS6AHG2CLAmOqcPDzh5TdMdYA= X-Received: by 2002:a05:6102:321b:: with SMTP id r27mr29696987vsf.13.1622033257578; Wed, 26 May 2021 05:47:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVJ0GkIwUjj/SnT+ky43SozLjtVHQDTyQ4X8v8jZZwJZjmUrTyX1krLd+798CTd0BMRkeRUQ== X-Received: by 2002:a05:6102:321b:: with SMTP id r27mr29696940vsf.13.1622033257072; Wed, 26 May 2021 05:47:37 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:36 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Cc: Adam Thomson Subject: [RESEND PATCH v2 04/13] mfd: da9062: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:02 -0400 Message-Id: <20210526124711.33223-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. Signed-off-by: Krzysztof Kozlowski Acked-by: Adam Thomson --- Changes since v1: 1. Add Ack 2. Correct subject prefix --- drivers/mfd/da9062-core.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index 8d913375152d..01f8e10dfa55 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -622,7 +623,6 @@ static int da9062_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct da9062 *chip; - const struct of_device_id *match; unsigned int irq_base; const struct mfd_cell *cell; const struct regmap_irq_chip *irq_chip; @@ -635,15 +635,10 @@ static int da9062_i2c_probe(struct i2c_client *i2c, if (!chip) return -ENOMEM; - if (i2c->dev.of_node) { - match = of_match_node(da9062_dt_ids, i2c->dev.of_node); - if (!match) - return -EINVAL; - - chip->chip_type = (uintptr_t)match->data; - } else { + if (i2c->dev.of_node) + chip->chip_type = (uintptr_t)of_device_get_match_data(&i2c->dev); + else chip->chip_type = id->driver_data; - } i2c_set_clientdata(i2c, chip); chip->dev = &i2c->dev; From patchwork Wed May 26 12:47:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 395C7C4708A for ; Wed, 26 May 2021 12:51:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CF05613D4 for ; Wed, 26 May 2021 12:51:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233460AbhEZMwg (ORCPT ); Wed, 26 May 2021 08:52:36 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56884 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234878AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -0400 Received: from mail-vs1-f70.google.com ([209.85.217.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswl-0000xb-IP for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:39 +0000 Received: by mail-vs1-f70.google.com with SMTP id v27-20020a67c89b0000b02902227f70aa8fso193816vsk.6 for ; Wed, 26 May 2021 05:47:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gi5LKjjP0bjXDjYj7Ix3Hw0qKjf6CelOHRk1zXBWnaI=; b=ACdUtXsuMfmYMnBqChDQy+B/9j/69sWwI/E67R+4Uxkk7lJfDZ87LfD8JO26zKmpcX 5tKZAq/WrNg0oAmYhd9CAyyiLNhRuhf3rJoO2HHMLj57ZjIZJLDbYPffgzK9Fq7ZncrQ +5f4ehD8NyHdTPB59Zao79mXEQ6KSie79f3Xr+YyivoY5deMiz4xffaevbqUo90kuL1r Yuu7g4Pu5MVbujGZzVvMv2NIane0lApGFx0W9yJb3s73Wfs7iRVO7k/qNBO0qAK0uFrw s6cqednPot55Gv8KVxmzWnDAAQjSiaIn63s0Jp4cjOYK6SimN3M0QFs3i9SYPGhRrVNh Nl5w== X-Gm-Message-State: AOAM532XoFxq21cBpKdRzkktVOOETyH0lT4LimNbFL7sZxu+rR9H1CzI RdPyOOzsMwORxr3fbOCGHagDUt9kF4Xab56S6cyXBqxfFHNifC9cPvd9ud06/Ev/8rlDRGYDlqv 9qB1ND9U6IZitk/91fgTN1r9Gz2Cqc35g02nWawM= X-Received: by 2002:a67:1087:: with SMTP id 129mr29581337vsq.42.1622033258713; Wed, 26 May 2021 05:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCM8BjysU8Rx+YcwLvtbPPjwicIzKBwQd2iZE/2FBz/KnmsXQzCZ4DPoAcGK75nk/My7ZDuA== X-Received: by 2002:a67:1087:: with SMTP id 129mr29581327vsq.42.1622033258573; Wed, 26 May 2021 05:47:38 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:38 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 05/13] mfd: sec: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:03 -0400 Message-Id: <20210526124711.33223-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. There is also no need to wrap it in a check for CONFIG_OF, because dev.of_node will be set only with OF support. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Remove check for CONFIG_OF as suggested by Marek --- drivers/mfd/sec-core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 8d55992da19e..15dd4c579937 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -323,14 +324,9 @@ sec_pmic_i2c_parse_dt_pdata(struct device *dev) static inline unsigned long sec_i2c_get_driver_data(struct i2c_client *i2c, const struct i2c_device_id *id) { -#ifdef CONFIG_OF - if (i2c->dev.of_node) { - const struct of_device_id *match; + if (i2c->dev.of_node) + return (unsigned long)of_device_get_match_data(&i2c->dev); - match = of_match_node(sec_dt_match, i2c->dev.of_node); - return (unsigned long)match->data; - } -#endif return id->driver_data; } From patchwork Wed May 26 12:47: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: 12281529 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 E0C4BC47088 for ; Wed, 26 May 2021 12:51:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C89DE613EC for ; Wed, 26 May 2021 12:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234447AbhEZMwq (ORCPT ); Wed, 26 May 2021 08:52:46 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56894 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234887AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -0400 Received: from mail-ua1-f69.google.com ([209.85.222.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswn-0000yc-I4 for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:41 +0000 Received: by mail-ua1-f69.google.com with SMTP id f15-20020a9f2bcf0000b02901f8fe91b89cso746314uaj.0 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=Oa7Vyx81dczeLtNvtVsWh0BYbY8PkWDpF7uTkyN8JBrQfHN/7rRwrrxh3pT4svzaeA lJ4+dIRn4LfdtJBGzFOMNIrG9I0iyfzAI1L1B1mCZN0pzAJ+ZJlYuHoveeJOa9RRKuYC XUi7hFJ6WrLWUHlsFfmzRCXWjZ0e0SexTpJTXUGV4qrLS2Osgsx9AzCNLe8dGpYnx8E+ jlEqvxFSML/7CsPinLPYqUVJR9sWFkYQY2O8pVzfL21xwvRwPefhy+wDf1w1cehlm24R BqmkURD0bFNlijckXAVBTzbFJ57u3O3nCFkB9iGdxSA+pB+FpWssvycovY6HlqIwJFRC pyCA== X-Gm-Message-State: AOAM533bBy6kzri1Xvq/G9/p7CLbUxUOutdsoTOyWinCND/Fq9ZPGIKU kgZlvayVxFfrIDzmNKCBMLvm7ENVUOj138pGi/B0KUa9lCz0p/LMZRKj2SJ+lEPKT1r/n72HG+t HHFgAsVusd954xt1ScqwIS2iVUmMgOaAUs737pjs= X-Received: by 2002:a67:ee07:: with SMTP id f7mr29741178vsp.55.1622033260695; 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-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 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: 12281525 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 F2FACC47088 for ; Wed, 26 May 2021 12:51:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D28D8613E6 for ; Wed, 26 May 2021 12:51:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234907AbhEZMwe (ORCPT ); Wed, 26 May 2021 08:52:34 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56913 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234889AbhEZMtP (ORCPT ); Wed, 26 May 2021 08:49:15 -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 1llswp-0000zV-I4 for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:43 +0000 Received: by mail-vs1-f72.google.com with SMTP id u21-20020a67c8150000b029022a6f03b431so194764vsk.9 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=Jmt66mBo46p+uzhw6zoSAZV2OwRg1ZF4/adqv02/qzJrIvpN/aLW+zRk03IUBTzSBS wKItxulxQ7j0W7QkRhkHTFWUI/C/NWjy/VeKCJkniqoCCzN/JmCdSPrH0ZgIf6CJl8dE cimD8xOxhRW3aQXjXyh8wsr4qy2ATvElJ9xuGZWhL389FegnEy1PsQ9PM6SFcym58AUc ez2YZr3OPwG/mU4OTc0n9DlobIR58vF62FDzOYMs4veV3XSj3cxDWtgz2zjlc/ERz0Nf 2C6cSYPnZnSz6rtETGNPo7SVo2ZTvJUo+nu9mRSDqYXXinvQ1aVROT6TP9FrjYs9jDF/ cjAQ== X-Gm-Message-State: AOAM53206hIVGnkA1kq48RWEiV1wujq/RwTVFWVfrrDtkhS9uOWlEkPL Xvkpm31O59xqjyyJtu0AUZ1BlEW3olGRcBbJ+xZ2odx/dVQABnv50n+MzrauXU0SKul9XzkMRB0 zEgv20QbFnbNXniK/yBWrHC73ibKIaYhBPpUq6mM= X-Received: by 2002:ab0:2690:: with SMTP id t16mr32616241uao.9.1622033262224; 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-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 * 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: 12281521 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 08944C47088 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 E4B696124B for ; Wed, 26 May 2021 12:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234389AbhEZMwW (ORCPT ); Wed, 26 May 2021 08:52:22 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56941 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234926AbhEZMt3 (ORCPT ); Wed, 26 May 2021 08:49:29 -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 1llsx3-00012Q-PQ for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:57 +0000 Received: by mail-ua1-f72.google.com with SMTP id d30-20020ab007de0000b029020e2f98646dso720644uaf.5 for ; Wed, 26 May 2021 05:47:57 -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=I08aMiP2w7bwJczMq6KNzh7aksRqu3VnCD/Vovwh/Ka3cuLQtofrbv/6gUXkWQ1QpL +lINm3XRD6W26grpr6AXMPKKJwo+QmEkRNEaF1d1CqyE+OJ1FA1PTqWkO1eFU57eF6AJ Znv4k7jzWjVzaI9aNpHwT2fPvhaN1OiAzMTtMJgXuojNxbyZZ3riUdOgdc0Ussp/zYMv qbwyLEPMUe3BGyFQscAbYw1Z7A3DK9JIrnzQJ1KYBe6hX33XdfKkHcd4FfPfaGB9hl3C QmQ5SRG1TEixHMPRiyFStU5ZSgw6Nc151i6nVImsaTaKpvi1o708sEBEdLlr9vOFehJS M72Q== X-Gm-Message-State: AOAM531Vf3DuZN2TGbQ/s3rfL1MRoy5ZOfHxMdAdjdgv9MJPQLbU2MFh 1c7OvuZOu5Fs4onwfYIJ/j4qZ30TY1+qEHT4MbpcwW/OysyYq0UuxOR1uTDyFEfhfMouJyHlN2h sB/gOIWQ/PUX6Av5F8NgGc84GsmQIqLUseyQGLZw= X-Received: by 2002:a67:db03:: with SMTP id z3mr26669031vsj.29.1622033270669; 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-omap@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: 12281513 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 147C8C47089 for ; Wed, 26 May 2021 12:50:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9AFD6113D for ; Wed, 26 May 2021 12:50:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234872AbhEZMvm (ORCPT ); Wed, 26 May 2021 08:51:42 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56922 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234910AbhEZMt0 (ORCPT ); Wed, 26 May 2021 08:49:26 -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 1llsx0-00010g-30 for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:54 +0000 Received: by mail-ua1-f72.google.com with SMTP id r4-20020ab070c40000b02902064b454facso719468ual.6 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=rBqcsafnRijToqztCR/KPyAab4hoqV5/CsmGcY7QV+Jzs++vIricNV5bEk5Dk476ko mDDVKCPV+5pSFfIxzYpvjoCHBBo7/1YbOdfibu/JKrPd6WbxSwcAvuucXCCxgrlN4u1B s6N4ewSDNEfpc7G0Mff8xyAvJYyGdieM2U2BDlW0FWtRxweepe5t2luktz4aNAVhMUiP 4Z2s6MPbJJfGgOOcQJDMm5InaYv2aR/Jg/5X9MTQdk15tzMJG55ir1F7ikfTeaLXxIXE QhEDxtcKLYGzr7K5ZeGV8BsQeo1fPoR2MGlOUl/dufBT+jF2a4scZSIs+ZrLcm9/gQDj im4Q== X-Gm-Message-State: AOAM530SZHfxYgiG93Kk7xrd6B1x+E/RGV632K/XNni8lP0nCuc+p9ty kZxRzxT0djLIR0bf9cULlWSCgwAEEcrCnYZcLFI7G0huoFcS4UzqkUM4qEoib5dDmWTKdszYfHc OnVZWuTGIqYdZfTCZKRKN+bfY00jNc1IiYf84NlA= X-Received: by 2002:a1f:2b14:: with SMTP id r20mr30492915vkr.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-omap@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: 12281523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 718CBC4708A for ; Wed, 26 May 2021 12:50:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56E886113D for ; Wed, 26 May 2021 12:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234246AbhEZMwZ (ORCPT ); Wed, 26 May 2021 08:52:25 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56931 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234919AbhEZMt1 (ORCPT ); Wed, 26 May 2021 08:49:27 -0400 Received: from mail-ua1-f72.google.com ([209.85.222.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsx1-00011Q-LQ for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:47:55 +0000 Received: by mail-ua1-f72.google.com with SMTP id b8-20020ab026c80000b029020f97f38cfcso726087uap.3 for ; Wed, 26 May 2021 05:47:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yas4eb6X58o/Bpn+7QlC+KUOEDd/pLhewc6kAqI5ERQ=; b=NWRXExz5YrBgnnsgFhTjzf8n0MStmn3O/h+EvMm7E+pHmz5vPSr3vQUnT4rz0cJ6Vv tyhbNxYDjxFRuxDitHqVDfZo84lz6wL5Ff9lGQOKeGJ9PKKavLiATFQ91mtAy8YDKzg4 2sZICXnZ9ZBk8OqcnDNUJImHA0YPlDHQ6TDucVBMATh2tDLxj6PONr2vH4RpfRtxkwug EtDnGGEr1MFeWu5INAF9v0D3WSsvUNrYwmoZACqz0+e1D14YljEX4aljKrchdbeRXSY7 S4u2tsPZangNtXAVAWJJRYIwlZL4tEFVlxHSpC3DfgLkym9RHpzdQkpnbe/0vEWilI1d INgA== X-Gm-Message-State: AOAM532dfyrxQw9RJViE7oYNYVD4Zx3kV+fL5V347jaxacTmRcPNa67t OG95lXEp2JSdUESucdHmHeimIxpZdWR4E7DpsOzpEPC9ySCzJ2tTBWkwW6bePxU8QTvuIX1iBL1 x9Gqrg7XlOyiHVHWdahk/rhvwaEhZqqcPeJzv3tc= X-Received: by 2002:a67:f303:: with SMTP id p3mr13195178vsf.37.1622033274859; Wed, 26 May 2021 05:47:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUp5kruxawn6cjhi4Yijw6pPdfl65zkfOmhAEzzR7+KwZhyv3ui12e7v0bfCZkpNWEQogC2g== X-Received: by 2002:a67:f303:: with SMTP id p3mr13195148vsf.37.1622033274657; Wed, 26 May 2021 05:47:54 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:53 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 10/13] mfd: sec: Remove unused device_type in platform data Date: Wed, 26 May 2021 08:47:08 -0400 Message-Id: <20210526124711.33223-11-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The 'device_type' field of platform data structure is not used and can be safely dropped. Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/sec-core.c | 5 +---- include/linux/mfd/samsung/core.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 653d02b98d53..4c4db3171ce6 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -318,7 +318,6 @@ static int sec_pmic_probe(struct i2c_client *i2c, struct sec_platform_data *pdata; const struct mfd_cell *sec_devs; struct sec_pmic_dev *sec_pmic; - unsigned long device_type; int ret, num_sec_devs; sec_pmic = devm_kzalloc(&i2c->dev, sizeof(struct sec_pmic_dev), @@ -330,16 +329,14 @@ static int sec_pmic_probe(struct i2c_client *i2c, sec_pmic->dev = &i2c->dev; sec_pmic->i2c = i2c; sec_pmic->irq = i2c->irq; - device_type = (unsigned long)of_device_get_match_data(sec_pmic->dev); pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev); if (IS_ERR(pdata)) { ret = PTR_ERR(pdata); return ret; } - pdata->device_type = device_type; - sec_pmic->device_type = pdata->device_type; + sec_pmic->device_type = (unsigned long)of_device_get_match_data(sec_pmic->dev); sec_pmic->irq_base = pdata->irq_base; sec_pmic->wakeup = pdata->wakeup; sec_pmic->pdata = pdata; diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 68afc2b97a41..bfde1b7c6303 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -81,7 +81,6 @@ int sec_irq_resume(struct sec_pmic_dev *sec_pmic); struct sec_platform_data { struct sec_regulator_data *regulators; struct sec_opmode_data *opmode; - int device_type; int num_regulators; int irq_base; From patchwork Wed May 26 12:47:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12281519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7996EC47089 for ; Wed, 26 May 2021 12:50:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59A006113D for ; Wed, 26 May 2021 12:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234353AbhEZMwQ (ORCPT ); Wed, 26 May 2021 08:52:16 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56944 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234934AbhEZMtc (ORCPT ); Wed, 26 May 2021 08:49:32 -0400 Received: from mail-ua1-f72.google.com ([209.85.222.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsx6-00012o-Qb for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:48:00 +0000 Received: by mail-ua1-f72.google.com with SMTP id t19-20020ab021530000b029020bc458f62fso694659ual.20 for ; Wed, 26 May 2021 05:48:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uIc+hPbkXVAFmDCofUL+b5FDgJB7wunjYixiHaMZC84=; b=XPh/izWzfGBd+M2wTzcBITsDDvM0Bar6St26+TbacLpbGLISyH4+hG7ul08BfiJe9s 4tfPzocntCrrju6AcSoqNhO0UkaaT9sv+JKaGNaGQFoZeGZzswg+rcSGLHgJ/hc5s5cA oPbwXQqtVUpBSGF8Cw4Wf9Wt2Lqn5st9p31CGc/N/UKiL9Jh4tA0jZO0TWsjSX/5C6Bs y8uQ9iP1J+rdimgt6VF2Y/9UPrdAAFWCLLYk8z3ydoeBUhnqxpocBOH8Au7lVMqnJrGi iTXLXMeuCrt/+v8bWOMYXPlVWPbMMmumSUAqyckWQWMwOTXEzS2l2vsjJzKweG+GQwxp 9voQ== X-Gm-Message-State: AOAM533rPdSnOFRKK8OsnzGaHdsa+aMQuROEmNmtTUIzQhBSfpcCMpmk bumYC8kQw/LXsG/DvvDk5qZgW3HPSsfiDod2jYVVCrqFI/GSnJiW+/52sJRPvFMbXKKYFCPrXaX 6maiOeyzozOFyNUM6zLoIigeRb/cZVoaqvlTRxZE= X-Received: by 2002:a05:6102:34d:: with SMTP id e13mr31166289vsa.31.1622033278871; Wed, 26 May 2021 05:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLUl9+FuXiCkKXpZ3BpbPb9nKcQP/WZDUuFCDhCOI3YfGCRJALALHfGFE0HuWGuTN1VN/SVQ== X-Received: by 2002:a05:6102:34d:: with SMTP id e13mr31166241vsa.31.1622033278318; Wed, 26 May 2021 05:47:58 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:57 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 11/13] mfd: sec: Remove unused irq_base in platform data Date: Wed, 26 May 2021 08:47:09 -0400 Message-Id: <20210526124711.33223-12-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The 'irq_base' field of platform data structure is not assigned, therefore its default value of 0 has no impact and can be safely dropped. Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/sec-core.c | 1 - drivers/mfd/sec-irq.c | 4 +--- include/linux/mfd/samsung/core.h | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 4c4db3171ce6..a9d4fbc51997 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -337,7 +337,6 @@ static int sec_pmic_probe(struct i2c_client *i2c, } sec_pmic->device_type = (unsigned long)of_device_get_match_data(sec_pmic->dev); - sec_pmic->irq_base = pdata->irq_base; sec_pmic->wakeup = pdata->wakeup; sec_pmic->pdata = pdata; diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c index a98c5d165039..e473c2fb42d5 100644 --- a/drivers/mfd/sec-irq.c +++ b/drivers/mfd/sec-irq.c @@ -444,7 +444,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) if (!sec_pmic->irq) { dev_warn(sec_pmic->dev, "No interrupt specified, no interrupts\n"); - sec_pmic->irq_base = 0; return 0; } @@ -482,8 +481,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) ret = devm_regmap_add_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic, sec_pmic->irq, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, - sec_pmic->irq_base, sec_irq_chip, - &sec_pmic->irq_data); + 0, sec_irq_chip, &sec_pmic->irq_data); if (ret != 0) { dev_err(sec_pmic->dev, "Failed to register IRQ chip: %d\n", ret); return ret; diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index bfde1b7c6303..9864f13b7814 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -67,7 +67,6 @@ struct sec_pmic_dev { struct i2c_client *i2c; unsigned long device_type; - int irq_base; int irq; struct regmap_irq_chip_data *irq_data; @@ -83,8 +82,6 @@ struct sec_platform_data { struct sec_opmode_data *opmode; int num_regulators; - int irq_base; - bool wakeup; bool buck_voltage_lock; From patchwork Wed May 26 12:47: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: 12281517 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 71E48C47088 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 54C40613E6 for ; Wed, 26 May 2021 12:50:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233770AbhEZMwN (ORCPT ); Wed, 26 May 2021 08:52:13 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56956 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234940AbhEZMtf (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-00013u-EY for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:48:03 +0000 Received: by mail-ua1-f70.google.com with SMTP id f2-20020ab006020000b02902124881cdf4so724532uaf.7 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=U+jAESvHkBYK4XvCyKLxb6YdYnH18J7x/miy58wt3/eL7cmz18rb62PfLXkw/l1CkO kA7bwjja44ZRqs48SF7Hn2aUBKwrR0jpUx95WConX3IOXR7s8ZX+EIXJF+DiKU/GsFgi E4bx7rdcL2d7SqgOwCa6Mg74vSt0MDwcxvNnh/PwIV7uDUiS7yvdP5WXD2mxlncR72Hd R4K/bPO/Cb+LA6ulKC6wPAx7rqWUKADwUaPACzaxZqiPmsqFSndk5SGfEaM17KOm0XKs w8Knq/h8sc6Kac+4Mt1AbnnLf4eTAvh3j6Bj93w/YrfILTGdqJVq2RFnCfoMRkA+Vfxl 78YQ== X-Gm-Message-State: AOAM533DdR7btgjeW+BQAXlLhfdhJMoZz/1p8SRAJrNH2sb6lAFovxMU CRjH2w3PQisNci6fCf++t0u5HQ75WuZ7p5sisd6rP6XyGotxQHL9g0SuMAfZHTWPtBbQRjN8TrX 95PspOv+V/nnbS2Xbjgcfdz0MKZxe2iS1B1KKR/A= X-Received: by 2002:a67:efda:: with SMTP id s26mr30788859vsp.8.1622033282593; 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-omap@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: 12281515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 314A7C47088 for ; Wed, 26 May 2021 12:50:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06D14613DC for ; Wed, 26 May 2021 12:50:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234928AbhEZMvx (ORCPT ); Wed, 26 May 2021 08:51:53 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56967 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234713AbhEZMth (ORCPT ); Wed, 26 May 2021 08:49:37 -0400 Received: from mail-vs1-f71.google.com ([209.85.217.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsxB-00014g-MB for linux-omap@vger.kernel.org; Wed, 26 May 2021 12:48:05 +0000 Received: by mail-vs1-f71.google.com with SMTP id v15-20020a67c00f0000b029023607a23f3dso193305vsi.10 for ; Wed, 26 May 2021 05:48:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0G840/6Lxcb0Mf0VQ/EHwzTpuJEk0LuU0gTLTIwmZhs=; b=LUja/VyrzVvB8gIMppkIxTfT1zDGk7VHzHfKPqC5DfUsLB/mi0jugeEoswPhfgOdwr dVGPOHm0P6klpouSu7OOGW0u6QsdG723XO8XWTjmpYxXjRaFcXo0m3GCAHyRrnqPo2ED fuoLGGzFvjNAAdWNnlb6Kpof42GONdqqVhfcbI00qiQFHVlH5zu0ORveLJJCRL3wrc3p DWYVdnrdW8/mbM+xDJeXnGU17UjFnLZbWpsH8mJR5Mps8/18MkV27EvvI0miX8oS94El GxWLjJt0G/se1ezEd3/BSQoONHB2MotvMNYnZG8dWAUNTn6Cb0c5/ruvXXXeloUGs3/4 lqRQ== X-Gm-Message-State: AOAM530fBjpIj639gbeqb4Cmvuv0+jyPGI7iRagIbd7PM6Vfyi2euSAf YgFNanxnOgcw7WvH8ye6iPWcNAkDS0heES9RU/MJywW7f55oZ2RcaGuJ4am9OY8ek1zLo6Ga/73 ciGlQhuqyQ1aXaLaZTCooY4YlYCBKo646To5sTmE= X-Received: by 2002:a67:ec4f:: with SMTP id z15mr29705037vso.27.1622033284477; Wed, 26 May 2021 05:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCoTnt6t9OzH8wpF2Ii6dBrFO6A3IuSsgipAxOrGMJk8cgaaL0/Ep+nV8/pkm14FWQbrzLzQ== X-Received: by 2002:a67:ec4f:: with SMTP id z15mr29705029vso.27.1622033284342; Wed, 26 May 2021 05:48:04 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:48:03 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 13/13] mfd: sec: Remove unused platform data members Date: Wed, 26 May 2021 08:47:11 -0400 Message-Id: <20210526124711.33223-14-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The Samsung PMIC drivers for early chipsets like S5M8767 stored quite a lot in platform data (struct sec_platform_data). The s5m8767 regulator driver currently references only some of its fields. Newer regulator drivers (e.g. s2mps11) use even less platform data fields. Clean up the structure to reduce memory footprint and source code size. Signed-off-by: Krzysztof Kozlowski --- include/linux/mfd/samsung/core.h | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index b0d049a56d16..f92fe090473d 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -80,8 +80,6 @@ struct sec_platform_data { struct sec_opmode_data *opmode; int num_regulators; - bool buck_voltage_lock; - int buck_gpios[3]; int buck_ds[3]; unsigned int buck2_voltage[8]; @@ -91,35 +89,12 @@ struct sec_platform_data { unsigned int buck4_voltage[8]; bool buck4_gpiodvs; - int buck_set1; - int buck_set2; - int buck_set3; - int buck2_enable; - int buck3_enable; - int buck4_enable; int buck_default_idx; - int buck2_default_idx; - int buck3_default_idx; - int buck4_default_idx; - int buck_ramp_delay; - int buck2_ramp_delay; - int buck34_ramp_delay; - int buck5_ramp_delay; - int buck16_ramp_delay; - int buck7810_ramp_delay; - int buck9_ramp_delay; - int buck24_ramp_delay; - int buck3_ramp_delay; - int buck7_ramp_delay; - int buck8910_ramp_delay; - - bool buck1_ramp_enable; bool buck2_ramp_enable; bool buck3_ramp_enable; bool buck4_ramp_enable; - bool buck6_ramp_enable; int buck2_init; int buck3_init;