mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-02 01:20:47 +09:00
mmc: mtk-sd: fix SPL compilation when GPIO=y and SPL_GPIO=n
It is not possible to link the SPL image when CONFIG_GPIO is enabled but CONFIG_SPL_GPIO is not. Use the IS_ENABLED macro instead to correctly check whether CONFIG_{SPL_}GPIO is enabled. This commit fixes the following errors: * undefined reference to `dm_gpio_get_value * undefined reference to `gpio_request_by_name' Signed-off-by: Fabien Parent <fparent@baylibre.com> [trini: Move guard to fix warning in msdc_ops_get_wp()] Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
924ed344a7
commit
70dbbd7269
@ -269,7 +269,7 @@ struct msdc_host {
|
|||||||
bool builtin_cd;
|
bool builtin_cd;
|
||||||
|
|
||||||
/* card detection / write protection GPIOs */
|
/* card detection / write protection GPIOs */
|
||||||
#ifdef CONFIG_DM_GPIO
|
#if IS_ENABLED(DM_GPIO)
|
||||||
struct gpio_desc gpio_wp;
|
struct gpio_desc gpio_wp;
|
||||||
struct gpio_desc gpio_cd;
|
struct gpio_desc gpio_cd;
|
||||||
#endif
|
#endif
|
||||||
@ -849,7 +849,7 @@ static int msdc_ops_get_cd(struct udevice *dev)
|
|||||||
return !(val & MSDC_PS_CDSTS);
|
return !(val & MSDC_PS_CDSTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DM_GPIO
|
#if IS_ENABLED(DM_GPIO)
|
||||||
if (!host->gpio_cd.dev)
|
if (!host->gpio_cd.dev)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@ -861,9 +861,9 @@ static int msdc_ops_get_cd(struct udevice *dev)
|
|||||||
|
|
||||||
static int msdc_ops_get_wp(struct udevice *dev)
|
static int msdc_ops_get_wp(struct udevice *dev)
|
||||||
{
|
{
|
||||||
|
#if IS_ENABLED(DM_GPIO)
|
||||||
struct msdc_host *host = dev_get_priv(dev);
|
struct msdc_host *host = dev_get_priv(dev);
|
||||||
|
|
||||||
#ifdef CONFIG_DM_GPIO
|
|
||||||
if (!host->gpio_wp.dev)
|
if (!host->gpio_wp.dev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -1332,7 +1332,7 @@ static int msdc_ofdata_to_platdata(struct udevice *dev)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#ifdef CONFIG_DM_GPIO
|
#if IS_ENABLED(DM_GPIO)
|
||||||
gpio_request_by_name(dev, "wp-gpios", 0, &host->gpio_wp, GPIOD_IS_IN);
|
gpio_request_by_name(dev, "wp-gpios", 0, &host->gpio_wp, GPIOD_IS_IN);
|
||||||
gpio_request_by_name(dev, "cd-gpios", 0, &host->gpio_cd, GPIOD_IS_IN);
|
gpio_request_by_name(dev, "cd-gpios", 0, &host->gpio_cd, GPIOD_IS_IN);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user