Skip to content

Commit

Permalink
regulator: raa215300: Change the scope of the variables {clkin_name, …
Browse files Browse the repository at this point in the history
…xin_name}

[ Upstream commit 42a9573 ]

Change the scope of the variables {clkin_name, xin_name} from global->local
to fix the below warning.

drivers/regulator/raa215300.c:42:12: sparse: sparse: symbol 'xin_name' was
not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306250552.Fan9WTiN-lkp@intel.com/
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230629104200.102663-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: e21ac64 ("regulator: raa215300: Fix resource leak in case of error")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Biju Das authored and gregkh committed Sep 19, 2023
1 parent fdb3a30 commit 749491b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions drivers/regulator/raa215300.c
Expand Up @@ -38,8 +38,6 @@
#define RAA215300_REG_BLOCK_EN_RTC_EN BIT(6)
#define RAA215300_RTC_DEFAULT_ADDR 0x6f

const char *clkin_name = "clkin";
const char *xin_name = "xin";
static struct clk *clk;

static const struct regmap_config raa215300_regmap_config = {
Expand Down Expand Up @@ -71,8 +69,10 @@ static int raa215300_clk_present(struct i2c_client *client, const char *name)
static int raa215300_i2c_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
const char *clk_name = xin_name;
const char *clkin_name = "clkin";
unsigned int pmic_version, val;
const char *xin_name = "xin";
const char *clk_name = NULL;
struct regmap *regmap;
int ret;

Expand Down Expand Up @@ -114,15 +114,17 @@ static int raa215300_i2c_probe(struct i2c_client *client)
ret = raa215300_clk_present(client, xin_name);
if (ret < 0) {
return ret;
} else if (!ret) {
} else if (ret) {
clk_name = xin_name;
} else {
ret = raa215300_clk_present(client, clkin_name);
if (ret < 0)
return ret;

clk_name = clkin_name;
if (ret)
clk_name = clkin_name;
}

if (ret) {
if (clk_name) {
char *name = pmic_version >= 0x12 ? "isl1208" : "raa215300_a0";
struct device_node *np = client->dev.of_node;
u32 addr = RAA215300_RTC_DEFAULT_ADDR;
Expand Down

0 comments on commit 749491b

Please sign in to comment.