From patchwork Sat Jan 28 14:53:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9543381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E979760415 for ; Sat, 28 Jan 2017 15:03:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAF0627C14 for ; Sat, 28 Jan 2017 15:03:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDC5228178; Sat, 28 Jan 2017 15:03:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 552FC27C14 for ; Sat, 28 Jan 2017 15:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752044AbdA1PDf (ORCPT ); Sat, 28 Jan 2017 10:03:35 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35979 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752136AbdA1PCN (ORCPT ); Sat, 28 Jan 2017 10:02:13 -0500 Received: by mail-pf0-f194.google.com with SMTP id 19so20406795pfo.3; Sat, 28 Jan 2017 07:02:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=9NDfs9oGjM7sOxANKxp77dOU/6xjumU1B31IRWPLR3E=; b=uZ9vTypFnR9lTL8DfyCLiuiCN5LuN/hDWKxodLOTRrJJ84BJ/8mp7o2848a/Cb6Mh1 tG4XmHdyS/ne14OvYycvLu6QWK1YLYrO1AjZCQTwvEzjWozGGTHYirZ9OZ9GGfJbR0mK jnYO1PeQhOUce33sK3ps3YDI58T8gEeH5LTzDY4R+RYLi7PElzR2LeZpAn4K/sH5ESMo avxxZPxcVH0o8fovRi+udA4O6Q7PnxdcJX2swHGSEuGiYnBoftklDIikTMD85Pq2/dPy bbzbM3lSe3wnl9HRgxEg7DoY/XIql3ts5bvEFKzSLxbRRZ94Vgub9dDfJlUupITIbs+W NbFQ== 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; bh=9NDfs9oGjM7sOxANKxp77dOU/6xjumU1B31IRWPLR3E=; b=QcYsg++t7W2aiRlCm5Gi3sKmv1ZT9cg6pUxWRjNKEJPZFUbzrjtjHqHHLypUzPDZbX ogFdncUifVK48N8ZelEnV7BlMJgMY2Dx+JnXnbRzVfugZrSRJWbzKeMT1HxqN4Dy2ySN gHLEQKQ4EEpmWNmmgwP+63RlixTNIjK2Dh57d/LvLwe4h7fhvpPxpOtnUlbC2lH0xe02 Wr7/BLwekzHd34cHveMCWEWHcIEhy+pGaomzaWYzT9C7I6gbbAr1u0a6EPHfK9IGraeT gxw39CZUhP7eLmfz4EGaQdpaKxU2+BBJE5afHtiTCrdA17IeXqpQ7nblqqkEA8tZ3aVs V61w== X-Gm-Message-State: AIkVDXKvGW1KJkZNl5xD6PyiBJGwt2KPfHcYZCYfi/RXDDiRc5onH4fkgqD9XppHaSEadg== X-Received: by 10.84.193.36 with SMTP id e33mr19826102pld.4.1485615246338; Sat, 28 Jan 2017 06:54:06 -0800 (PST) Received: from gmail.com ([2405:204:5389:e510:bd16:6964:3af1:7817]) by smtp.gmail.com with ESMTPSA id 66sm19636120pgg.47.2017.01.28.06.54.01 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 28 Jan 2017 06:54:05 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Sat, 28 Jan 2017 20:23:58 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, lgirdwood@gmail.com, broonie@kernel.org, linux-kernel@vger.kernel.org, tony@atomide.com, linux-omap@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] regulator: palmas-regulator: constify regulator_ops structure Date: Sat, 28 Jan 2017 20:23:55 +0530 Message-Id: <1485615235-30571-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Declare regulator_ops structure as const as it is only stored in the ops field of a regulator_desc structure. This field is of type const, so regulator_ops structures having this property can be made const too. File size before: drivers/regulator/palmas-regulator.o text data bss dec hex filename 9752 6296 288 16336 3fd0 regulator/palmas-regulator.o File size after: drivers/regulator/palmas-regulator.o text data bss dec hex filename 12856 3480 8 16344 3fd0 regulator/palmas-regulator.o Signed-off-by: Bhumika Goyal --- drivers/regulator/palmas-regulator.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index f11d41d..31ae5ee 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -528,7 +528,7 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev *rdev, return ret; } -static struct regulator_ops palmas_ops_smps = { +static const struct regulator_ops palmas_ops_smps = { .is_enabled = regulator_is_enabled_regmap, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -542,7 +542,7 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev *rdev, .set_ramp_delay = palmas_smps_set_ramp_delay, }; -static struct regulator_ops palmas_ops_ext_control_smps = { +static const struct regulator_ops palmas_ops_ext_control_smps = { .set_mode = palmas_set_mode_smps, .get_mode = palmas_get_mode_smps, .get_voltage_sel = regulator_get_voltage_sel_regmap, @@ -553,7 +553,7 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev *rdev, .set_ramp_delay = palmas_smps_set_ramp_delay, }; -static struct regulator_ops palmas_ops_smps10 = { +static const struct regulator_ops palmas_ops_smps10 = { .is_enabled = regulator_is_enabled_regmap, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -565,7 +565,7 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev *rdev, .get_bypass = regulator_get_bypass_regmap, }; -static struct regulator_ops tps65917_ops_smps = { +static const struct regulator_ops tps65917_ops_smps = { .is_enabled = regulator_is_enabled_regmap, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -578,7 +578,7 @@ static int palmas_smps_set_ramp_delay(struct regulator_dev *rdev, .set_voltage_time_sel = regulator_set_voltage_time_sel, }; -static struct regulator_ops tps65917_ops_ext_control_smps = { +static const struct regulator_ops tps65917_ops_ext_control_smps = { .set_mode = palmas_set_mode_smps, .get_mode = palmas_get_mode_smps, .get_voltage_sel = regulator_get_voltage_sel_regmap, @@ -602,7 +602,7 @@ static int palmas_is_enabled_ldo(struct regulator_dev *dev) return !!(reg); } -static struct regulator_ops palmas_ops_ldo = { +static const struct regulator_ops palmas_ops_ldo = { .is_enabled = palmas_is_enabled_ldo, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -612,7 +612,7 @@ static int palmas_is_enabled_ldo(struct regulator_dev *dev) .map_voltage = regulator_map_voltage_linear, }; -static struct regulator_ops palmas_ops_ldo9 = { +static const struct regulator_ops palmas_ops_ldo9 = { .is_enabled = palmas_is_enabled_ldo, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -624,23 +624,23 @@ static int palmas_is_enabled_ldo(struct regulator_dev *dev) .get_bypass = regulator_get_bypass_regmap, }; -static struct regulator_ops palmas_ops_ext_control_ldo = { +static const struct regulator_ops palmas_ops_ext_control_ldo = { .get_voltage_sel = regulator_get_voltage_sel_regmap, .set_voltage_sel = regulator_set_voltage_sel_regmap, .list_voltage = regulator_list_voltage_linear, .map_voltage = regulator_map_voltage_linear, }; -static struct regulator_ops palmas_ops_extreg = { +static const struct regulator_ops palmas_ops_extreg = { .is_enabled = regulator_is_enabled_regmap, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, }; -static struct regulator_ops palmas_ops_ext_control_extreg = { +static const struct regulator_ops palmas_ops_ext_control_extreg = { }; -static struct regulator_ops tps65917_ops_ldo = { +static const struct regulator_ops tps65917_ops_ldo = { .is_enabled = palmas_is_enabled_ldo, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -651,7 +651,7 @@ static int palmas_is_enabled_ldo(struct regulator_dev *dev) .set_voltage_time_sel = regulator_set_voltage_time_sel, }; -static struct regulator_ops tps65917_ops_ldo_1_2 = { +static const struct regulator_ops tps65917_ops_ldo_1_2 = { .is_enabled = palmas_is_enabled_ldo, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap,