mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 02:34:01 +08:00
i2c: mv64xxx: Fix some build warnings
Some functions and variables are only used if the configuration selects HAVE_CLK. Protect them with a corresponding #ifdef CONFIG_HAVE_CLK block to avoid compiler warnings. Signed-off-by: Thierry Reding <treding@nvidia.com> [wsa: added marker to #endif] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
153369139a
commit
c1a9946780
@ -697,6 +697,7 @@ static const struct of_device_id mv64xxx_i2c_of_match_table[] = {
|
|||||||
MODULE_DEVICE_TABLE(of, mv64xxx_i2c_of_match_table);
|
MODULE_DEVICE_TABLE(of, mv64xxx_i2c_of_match_table);
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
|
#ifdef CONFIG_HAVE_CLK
|
||||||
static int
|
static int
|
||||||
mv64xxx_calc_freq(const int tclk, const int n, const int m)
|
mv64xxx_calc_freq(const int tclk, const int n, const int m)
|
||||||
{
|
{
|
||||||
@ -726,16 +727,12 @@ mv64xxx_find_baud_factors(const u32 req_freq, const u32 tclk, u32 *best_n,
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_HAVE_CLK */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
|
mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
|
||||||
struct device *dev)
|
struct device *dev)
|
||||||
{
|
{
|
||||||
const struct of_device_id *device;
|
|
||||||
struct device_node *np = dev->of_node;
|
|
||||||
u32 bus_freq, tclk;
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
/* CLK is mandatory when using DT to describe the i2c bus. We
|
/* CLK is mandatory when using DT to describe the i2c bus. We
|
||||||
* need to know tclk in order to calculate bus clock
|
* need to know tclk in order to calculate bus clock
|
||||||
* factors.
|
* factors.
|
||||||
@ -744,6 +741,11 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
|
|||||||
/* Have OF but no CLK */
|
/* Have OF but no CLK */
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
#else
|
#else
|
||||||
|
const struct of_device_id *device;
|
||||||
|
struct device_node *np = dev->of_node;
|
||||||
|
u32 bus_freq, tclk;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
if (IS_ERR(drv_data->clk)) {
|
if (IS_ERR(drv_data->clk)) {
|
||||||
rc = -ENODEV;
|
rc = -ENODEV;
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user