Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp888848rdb; Fri, 1 Sep 2023 07:07:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEr5axONqqYuOO+yATSNzl8xrak4r3AdQZJgVmSCfcE4txXQKB6wqKuRA+b9fAt/lnlPMdD X-Received: by 2002:a05:6512:118d:b0:4fb:821e:2241 with SMTP id g13-20020a056512118d00b004fb821e2241mr2189437lfr.23.1693577245927; Fri, 01 Sep 2023 07:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693577245; cv=none; d=google.com; s=arc-20160816; b=SiaqAlzmCPg+EP4Yb/uhisgEYG32sTD8wiJ9iLnNsb98Yx5azOdZeBnHLeQGrUa5YO ki53eXsXen9/OWhBkB2BviWDsF5tLooqD5NXkujrS1JTiEbYSeVfc5bp0+HJsd7dn8RZ SoLKfdbU3ZiEgHd9DRjJBW7TFagQsWmG/8QmvPw/vR4M9Vo7RvXJzhiPZ2eGJRGluLDn D9L9ih5qD8tv7ZSVHg3k6Zd6N2j3lkBSCABGLEukjyhbO3YEfWGS7/izaagvfjrEJ+Xl NKlnWv9j5QfWBkpW3Co8lt7FCHGM2j7+cGFD2fxehjTZakYjGJSQG40vrjQvkRezgtoR Ud3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YldUtx+KMVHOx/PR3E7h/9phI8XzjJoQL3kro4pD9RY=; fh=VdeWdNv2Y3HwtDbQJ/FB5+bX4+EoEjY9/LxfbUHZuDA=; b=ZD8/My/HjvZOR+M1v7ZFD2G76t9hTr8BthRdPzXnhdRTHxccixCR8WSlBBo9/rASgu XwLQwN+CHMoqmUuItWGfRBUfeHzgqMZ6ZrvxtH/vpM+4A9cGCUHO5ZM8qWxc4IYcsHFx 0HZVmu7OP2lOSDtlD7VgNanKsTCM5mtKBdMObgZT0XWebVULS049DTuHMumfNURqUPZu FAGJ0TcAT2Ho2EsQXKh3BdNE4p0/oZpbV8gzTbXaqAWxFBFoD49U6W882jEpdzOWoKMH 91hH93GV8RH20RlIoA3F8eTwuaUeeMLj+iovj1ox/BG47bpm3GqZPZFIC7i1NDLHDSfq +bdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s26-20020a056402165a00b005254cd1b36csi2555767edx.69.2023.09.01.07.06.34; Fri, 01 Sep 2023 07:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347042AbjHaScG (ORCPT + 93 others); Thu, 31 Aug 2023 14:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347038AbjHaScG (ORCPT ); Thu, 31 Aug 2023 14:32:06 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F308E5F; Thu, 31 Aug 2023 11:32:03 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174628372" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 03:32:02 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id E66FB40029A1; Fri, 1 Sep 2023 03:32:00 +0900 (JST) From: Biju Das To: Tony Lindgren , Lee Jones Cc: Biju Das , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v3 2/4] mfd: palmas: Constify .data in OF table and {palmas,tps65917}_irq_chip Date: Thu, 31 Aug 2023 19:31:51 +0100 Message-Id: <20230831183153.63750-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> References: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Constify .data in OF table and {palmas,tps65917}_irq_chip and replace the variable *features->features in struct palmas_driver_data and drop the {palmas,tps659038}_features variables and use their values directly in the named initialization. Signed-off-by: Biju Das --- v2->v3: * Restored the OF table position and moved near to the user in patch#3. v1->v2: * Moved the OF table just above its user. * Removed trailing comma from the terminator entry for the OF table. --- drivers/mfd/palmas.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 769538b50903..3c0a3d644834 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -296,7 +296,7 @@ static const struct regmap_irq palmas_irqs[] = { }, }; -static struct regmap_irq_chip palmas_irq_chip = { +static const struct regmap_irq_chip palmas_irq_chip = { .name = "palmas", .irqs = palmas_irqs, .num_irqs = ARRAY_SIZE(palmas_irqs), @@ -309,7 +309,7 @@ static struct regmap_irq_chip palmas_irq_chip = { PALMAS_INT1_MASK), }; -static struct regmap_irq_chip tps65917_irq_chip = { +static const struct regmap_irq_chip tps65917_irq_chip = { .name = "tps65917", .irqs = tps65917_irqs, .num_irqs = ARRAY_SIZE(tps65917_irqs), @@ -463,26 +463,21 @@ static void palmas_power_off(void) __func__, ret); } -static unsigned int palmas_features = PALMAS_PMIC_FEATURE_SMPS10_BOOST; -static unsigned int tps659038_features; - struct palmas_driver_data { - unsigned int *features; - struct regmap_irq_chip *irq_chip; + unsigned int features; + const struct regmap_irq_chip *irq_chip; }; -static struct palmas_driver_data palmas_data = { - .features = &palmas_features, +static const struct palmas_driver_data palmas_data = { + .features = PALMAS_PMIC_FEATURE_SMPS10_BOOST, .irq_chip = &palmas_irq_chip, }; -static struct palmas_driver_data tps659038_data = { - .features = &tps659038_features, +static const struct palmas_driver_data tps659038_data = { .irq_chip = &palmas_irq_chip, }; -static struct palmas_driver_data tps65917_data = { - .features = &tps659038_features, +static const struct palmas_driver_data tps65917_data = { .irq_chip = &tps65917_irq_chip, }; @@ -507,7 +502,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c) { struct palmas *palmas; struct palmas_platform_data *pdata; - struct palmas_driver_data *driver_data; + const struct palmas_driver_data *driver_data; struct device_node *node = i2c->dev.of_node; int ret = 0, i; unsigned int reg, addr; @@ -535,8 +530,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c) palmas->dev = &i2c->dev; palmas->irq = i2c->irq; - driver_data = (struct palmas_driver_data *) device_get_match_data(&i2c->dev); - palmas->features = *driver_data->features; + driver_data = device_get_match_data(&i2c->dev); + palmas->features = driver_data->features; for (i = 0; i < PALMAS_NUM_CLIENTS; i++) { if (i == 0) -- 2.25.1