Skip to content

Commit

Permalink
phy: ti: j721e-wiz: Constify structs
Browse files Browse the repository at this point in the history
clk_div_table and wiz_regmap_config are not modified and can therefore
be made const to allow the compiler to put them in read-only memory.

Before:
   text    data     bss     dec     hex filename
  20265    7044      64   27373    6aed drivers/phy/ti/phy-j721e-wiz.o

After:
   text    data     bss     dec     hex filename
  20649    6660      64   27373    6aed drivers/phy/ti/phy-j721e-wiz.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200524095516.25227-3-rikard.falkeborn@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Rikard Falkeborn authored and Vinod Koul committed Jun 24, 2020
1 parent 0cb5ebc commit 5a72122
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/phy/ti/phy-j721e-wiz.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct wiz_clk_mux {
struct wiz_clk_divider {
struct clk_hw hw;
struct regmap_field *field;
struct clk_div_table *table;
const struct clk_div_table *table;
struct clk_init_data clk_data;
};

Expand All @@ -131,7 +131,7 @@ struct wiz_clk_mux_sel {

struct wiz_clk_div_sel {
struct regmap_field *field;
struct clk_div_table *table;
const struct clk_div_table *table;
const char *node_name;
};

Expand Down Expand Up @@ -173,7 +173,7 @@ static struct wiz_clk_mux_sel clk_mux_sel_10g[] = {
},
};

static struct clk_div_table clk_div_table[] = {
static const struct clk_div_table clk_div_table[] = {
{ .val = 0, .div = 1, },
{ .val = 1, .div = 2, },
{ .val = 2, .div = 4, },
Expand Down Expand Up @@ -559,7 +559,7 @@ static const struct clk_ops wiz_clk_div_ops = {

static int wiz_div_clk_register(struct wiz *wiz, struct device_node *node,
struct regmap_field *field,
struct clk_div_table *table)
const struct clk_div_table *table)
{
struct device *dev = wiz->dev;
struct wiz_clk_divider *div;
Expand Down Expand Up @@ -756,7 +756,7 @@ static const struct reset_control_ops wiz_phy_reset_ops = {
.deassert = wiz_phy_reset_deassert,
};

static struct regmap_config wiz_regmap_config = {
static const struct regmap_config wiz_regmap_config = {
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
Expand Down

0 comments on commit 5a72122

Please sign in to comment.