mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-15 19:51:37 +00:00
pinctrl: starfive: Fix the crash problem when using gpio cmd
starfive_pinctrl_priv struct is a priv of the parent device (pinctrl device), not the gpio device. Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
This commit is contained in:
parent
1d5b928204
commit
bf37dcc538
1 changed files with 2 additions and 2 deletions
|
@ -278,7 +278,7 @@ const struct pinctrl_ops starfive_pinctrl_ops = {
|
|||
static int starfive_gpio_direction_input(struct udevice *dev, unsigned int off)
|
||||
{
|
||||
struct udevice *pdev = dev->parent;
|
||||
struct starfive_pinctrl_priv *priv = dev_get_priv(dev);
|
||||
struct starfive_pinctrl_priv *priv = dev_get_priv(pdev);
|
||||
struct starfive_pinctrl_soc_info *info = priv->info;
|
||||
|
||||
/* enable input and schmitt trigger */
|
||||
|
@ -297,7 +297,7 @@ static int starfive_gpio_direction_output(struct udevice *dev,
|
|||
unsigned int off, int val)
|
||||
{
|
||||
struct udevice *pdev = dev->parent;
|
||||
struct starfive_pinctrl_priv *priv = dev_get_priv(dev);
|
||||
struct starfive_pinctrl_priv *priv = dev_get_priv(pdev);
|
||||
struct starfive_pinctrl_soc_info *info = priv->info;
|
||||
|
||||
if (info->set_one_pinmux)
|
||||
|
|
Loading…
Add table
Reference in a new issue