Skip to content

Commit 6cf238d

Browse files
YueHaibingkrzk
authored andcommitted
memory: omap-gpmc: Fix -Wunused-function warnings
If CONFIG_OF is not set, make W=1 warns: drivers/memory/omap-gpmc.c:987:12: warning: ‘gpmc_cs_remap’ defined but not used [-Wunused-function] drivers/memory/omap-gpmc.c:926:20: warning: ‘gpmc_cs_get_name’ defined but not used [-Wunused-function] drivers/memory/omap-gpmc.c:919:13: warning: ‘gpmc_cs_set_name’ defined but not used [-Wunused-function] Move them to #ifdef CONFIG_OF block to fix this. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Roger Quadros <rogerq@ti.com> Link: https://lore.kernel.org/r/20200901112832.3084-1-yuehaibing%40huawei.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
1 parent ea90f66 commit 6cf238d

1 file changed

Lines changed: 57 additions & 57 deletions

File tree

drivers/memory/omap-gpmc.c

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -917,20 +917,6 @@ static bool gpmc_cs_reserved(int cs)
917917
return gpmc->flags & GPMC_CS_RESERVED;
918918
}
919919

920-
static void gpmc_cs_set_name(int cs, const char *name)
921-
{
922-
struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
923-
924-
gpmc->name = name;
925-
}
926-
927-
static const char *gpmc_cs_get_name(int cs)
928-
{
929-
struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
930-
931-
return gpmc->name;
932-
}
933-
934920
static unsigned long gpmc_mem_align(unsigned long size)
935921
{
936922
int order;
@@ -976,49 +962,6 @@ static int gpmc_cs_delete_mem(int cs)
976962
return r;
977963
}
978964

979-
/**
980-
* gpmc_cs_remap - remaps a chip-select physical base address
981-
* @cs: chip-select to remap
982-
* @base: physical base address to re-map chip-select to
983-
*
984-
* Re-maps a chip-select to a new physical base address specified by
985-
* "base". Returns 0 on success and appropriate negative error code
986-
* on failure.
987-
*/
988-
static int gpmc_cs_remap(int cs, u32 base)
989-
{
990-
int ret;
991-
u32 old_base, size;
992-
993-
if (cs >= gpmc_cs_num) {
994-
pr_err("%s: requested chip-select is disabled\n", __func__);
995-
return -ENODEV;
996-
}
997-
998-
/*
999-
* Make sure we ignore any device offsets from the GPMC partition
1000-
* allocated for the chip select and that the new base confirms
1001-
* to the GPMC 16MB minimum granularity.
1002-
*/
1003-
base &= ~(SZ_16M - 1);
1004-
1005-
gpmc_cs_get_memconf(cs, &old_base, &size);
1006-
if (base == old_base)
1007-
return 0;
1008-
1009-
ret = gpmc_cs_delete_mem(cs);
1010-
if (ret < 0)
1011-
return ret;
1012-
1013-
ret = gpmc_cs_insert_mem(cs, base, size);
1014-
if (ret < 0)
1015-
return ret;
1016-
1017-
ret = gpmc_cs_set_memconf(cs, base, size);
1018-
1019-
return ret;
1020-
}
1021-
1022965
int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
1023966
{
1024967
struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
@@ -1942,6 +1885,63 @@ static const struct of_device_id gpmc_dt_ids[] = {
19421885
{ }
19431886
};
19441887

1888+
static void gpmc_cs_set_name(int cs, const char *name)
1889+
{
1890+
struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
1891+
1892+
gpmc->name = name;
1893+
}
1894+
1895+
static const char *gpmc_cs_get_name(int cs)
1896+
{
1897+
struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
1898+
1899+
return gpmc->name;
1900+
}
1901+
1902+
/**
1903+
* gpmc_cs_remap - remaps a chip-select physical base address
1904+
* @cs: chip-select to remap
1905+
* @base: physical base address to re-map chip-select to
1906+
*
1907+
* Re-maps a chip-select to a new physical base address specified by
1908+
* "base". Returns 0 on success and appropriate negative error code
1909+
* on failure.
1910+
*/
1911+
static int gpmc_cs_remap(int cs, u32 base)
1912+
{
1913+
int ret;
1914+
u32 old_base, size;
1915+
1916+
if (cs >= gpmc_cs_num) {
1917+
pr_err("%s: requested chip-select is disabled\n", __func__);
1918+
return -ENODEV;
1919+
}
1920+
1921+
/*
1922+
* Make sure we ignore any device offsets from the GPMC partition
1923+
* allocated for the chip select and that the new base confirms
1924+
* to the GPMC 16MB minimum granularity.
1925+
*/
1926+
base &= ~(SZ_16M - 1);
1927+
1928+
gpmc_cs_get_memconf(cs, &old_base, &size);
1929+
if (base == old_base)
1930+
return 0;
1931+
1932+
ret = gpmc_cs_delete_mem(cs);
1933+
if (ret < 0)
1934+
return ret;
1935+
1936+
ret = gpmc_cs_insert_mem(cs, base, size);
1937+
if (ret < 0)
1938+
return ret;
1939+
1940+
ret = gpmc_cs_set_memconf(cs, base, size);
1941+
1942+
return ret;
1943+
}
1944+
19451945
/**
19461946
* gpmc_read_settings_dt - read gpmc settings from device-tree
19471947
* @np: pointer to device-tree node for a gpmc child device

0 commit comments

Comments
 (0)