Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7283960yba; Thu, 2 May 2019 07:23:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYNt297xu82f1KHqYmXC42S8P96zAhuPU4QKnHqJxjR160rufzgiD8leS7Ak7EUs9WQrNN X-Received: by 2002:a63:5c1b:: with SMTP id q27mr4336466pgb.127.1556807039300; Thu, 02 May 2019 07:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556807039; cv=none; d=google.com; s=arc-20160816; b=JqfDmY0G8gK1cXp6aA6NR0V31moJzr1BRNoxOTRfRxEXGXerCeiKPINMgRAV6bvDaJ KKhCjI8hqUL2HuYBR77oQOwN+IsDQ0seZ8y1xMOhkFzMRnBVTL8HG0pVtjKZu3N9Eb/6 j2xmqTo2Ul5LxceDrAJ3uGoZKLFosh8Sj25bpLjPwTn8L5v+fJax6/hRf+0fGTblR4eF 9OmzoKZ54sJE8bnmgfm/yLOYMO5mFmgbICYr8gzfjrQQOx3qRiWOSX7GjIx54T4Ct8/h HvN9Iaa1ajXGl5V0LqqjpOyJAi9I7pm0gOV7xEVFSwmmmfJcSE3JwoEvTQP+9voNVfvc NlMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SaC3CyEpnIvyDl6CAhIhixQUIs6TW3hTPrV/tsa7jKQ=; b=XYjG0FC2P7ZVww5V7nmKDjT3t4xbgX7RqAQvmrrXR/aJkF7YnSbEf7xZNpCD7+hypb /36BzDx72GM7Vl8cJgss5HjaQl10RuylZepoL+4n0d83J4gRguKzj69MsGd0rL8KnxnX GKV6VB7V9W9rlDkPACVOjs0bR17rXPPzP6lGBfE5vlE0VUdLaS3SfeWze7jW08TkrBpd GJTtmUIHI8FdsIizpU6266+oSHxuDcYu6cYS8mrTonoV6XtklBaaVOS+21G0nOm4CysJ 4Sz7HKOKluczb3MEKDgnhsRCKfw6ig8q2TI11P5bli/gkGciWJptpIY2vh568m64w/vN k9Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ingics-com.20150623.gappssmtp.com header.s=20150623 header.b=YdLPiUFz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si23071275plr.192.2019.05.02.07.23.41; Thu, 02 May 2019 07:23:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ingics-com.20150623.gappssmtp.com header.s=20150623 header.b=YdLPiUFz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726334AbfEBOWq (ORCPT + 99 others); Thu, 2 May 2019 10:22:46 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43776 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbfEBOWp (ORCPT ); Thu, 2 May 2019 10:22:45 -0400 Received: by mail-pf1-f196.google.com with SMTP id e67so1198023pfe.10 for ; Thu, 02 May 2019 07:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SaC3CyEpnIvyDl6CAhIhixQUIs6TW3hTPrV/tsa7jKQ=; b=YdLPiUFz+23S/TEzjzbgk+QjIRunn9ceVTO7eXkw4bP8J/N7AMEUCz4GF+kOt+8H43 yqoHUil0onwgdjpqyz1drCYD3UyPRqLZyl8zm9Et8i1Baw3FEBQUtZKqqzegXPjliHVL Nr1HL6z2TGQUK3o0b/ryywyesEE8XB8m1GcMQTbnwtTm4jgio+f/2+W4OuMT/fwfk6fB DJ3rRFXXtwy1CSOXa7/Odsy9fcOjDUygMehG90HUEIHi2BPIy8A+cyqiB4OaKqs3u8e2 cvh4liwtngh5H/4beEnT6IV4Yf8tYHRArtzyyZNEAcEu5RzotxzXPpDJrMYLKZQ7LAbZ wjew== 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=SaC3CyEpnIvyDl6CAhIhixQUIs6TW3hTPrV/tsa7jKQ=; b=TKLbUu6BzWPrSwmr1xl1FSxhOxsKfuUpjk/LcMGCXucE9UfC++hQ3C7QWDZe2S1NL4 5z/oivEgUUj/8uEd0VloK8Xq5Cs9AZREfIWMMNA9ZB/vu8QvwtCrNMB0gfnBArpL7rBH 7BAuS1dAfOt7iFnzlxsrn1zc0BUFRQMuAVevt+47JIaH8+VuI759kekOMj8PV6BoNZOj m9ZhAI8cdHnduOfzkqfvNUazGlcu292x/uwiLxFGfV0auMYwMXiyDucsGCrm6+duZu60 jNLdjzQsi6zn4zKOp/bV0XaXu/lacVW1HJIFzM1oGxSBqgl9uy0o06kwb8KoS/It+rpD 2R5A== X-Gm-Message-State: APjAAAX+QiCsdxrculeieacMEdNFM7L8KSZtsuejDORK+Muuk495NjEa Mtz18JFgA6wCvSwkmGgqD94KJA== X-Received: by 2002:aa7:9285:: with SMTP id j5mr4453265pfa.129.1556806964838; Thu, 02 May 2019 07:22:44 -0700 (PDT) Received: from localhost.localdomain (36-239-226-61.dynamic-ip.hinet.net. [36.239.226.61]) by smtp.gmail.com with ESMTPSA id h127sm64750452pgc.31.2019.05.02.07.22.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 07:22:44 -0700 (PDT) From: Axel Lin To: Mark Brown Cc: Linus Walleij , Liam Girdwood , linux-kernel@vger.kernel.org, Axel Lin Subject: [PATCH 1/2] regulator: ab3100: Constify regulator_ops and ab3100_regulator_desc Date: Thu, 2 May 2019 22:22:32 +0800 Message-Id: <20190502142233.24730-1-axel.lin@ingics.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These regulator_ops variables and ab3100_regulator_desc array never need to be modified, make them const so compiler can put them to .rodata. Signed-off-by: Axel Lin --- drivers/regulator/ab3100.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index c92966a79a7e..edde907a7062 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c @@ -353,14 +353,14 @@ static int ab3100_get_voltage_regulator_external(struct regulator_dev *reg) return 0; } -static struct regulator_ops regulator_ops_fixed = { +static const struct regulator_ops regulator_ops_fixed = { .list_voltage = regulator_list_voltage_linear, .enable = ab3100_enable_regulator, .disable = ab3100_disable_regulator, .is_enabled = ab3100_is_enabled_regulator, }; -static struct regulator_ops regulator_ops_variable = { +static const struct regulator_ops regulator_ops_variable = { .enable = ab3100_enable_regulator, .disable = ab3100_disable_regulator, .is_enabled = ab3100_is_enabled_regulator, @@ -369,7 +369,7 @@ static struct regulator_ops regulator_ops_variable = { .list_voltage = regulator_list_voltage_table, }; -static struct regulator_ops regulator_ops_variable_sleepable = { +static const struct regulator_ops regulator_ops_variable_sleepable = { .enable = ab3100_enable_regulator, .disable = ab3100_disable_regulator, .is_enabled = ab3100_is_enabled_regulator, @@ -385,14 +385,14 @@ static struct regulator_ops regulator_ops_variable_sleepable = { * is an on/off switch plain an simple. The external * voltage is defined in the board set-up if any. */ -static struct regulator_ops regulator_ops_external = { +static const struct regulator_ops regulator_ops_external = { .enable = ab3100_enable_regulator, .disable = ab3100_disable_regulator, .is_enabled = ab3100_is_enabled_regulator, .get_voltage = ab3100_get_voltage_regulator_external, }; -static struct regulator_desc +static const struct regulator_desc ab3100_regulator_desc[AB3100_NUM_REGULATORS] = { { .name = "LDO_A", @@ -499,7 +499,7 @@ static int ab3100_regulator_register(struct platform_device *pdev, struct device_node *np, unsigned long id) { - struct regulator_desc *desc; + const struct regulator_desc *desc; struct ab3100_regulator *reg; struct regulator_dev *rdev; struct regulator_config config = { }; @@ -688,7 +688,7 @@ static int ab3100_regulators_probe(struct platform_device *pdev) /* Register the regulators */ for (i = 0; i < AB3100_NUM_REGULATORS; i++) { - struct regulator_desc *desc = &ab3100_regulator_desc[i]; + const struct regulator_desc *desc = &ab3100_regulator_desc[i]; err = ab3100_regulator_register(pdev, plfdata, NULL, NULL, desc->id); -- 2.20.1