[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting gpio_list->num_in

From: Peter Maydell
Subject: Re: setting gpio_list->num_in
Date: Wed, 7 Apr 2021 08:39:52 +0000

On Wed, 7 Apr 2021 at 09:29, Rahul Jain <tkg.rahul@gmail.com> wrote:
> Hi All,
> I am getting assert(n >= 0 && n < gpio_list->num_in);  while calling 
> qdev_get_gpio_in(),
> I am unable to find how to set the value in gpio_list->num_in?

This assertion means you're trying to get a GPIO line which doesn't
exist on the device (eg you're asking for GPIO line number 5 but
the device only provides 0..4).

Either your calling code is using the wrong number, or the device you're
using has a bug where it isn't providing the right number of lines (it
specifies this when it calls qdev_init_gpio_in()), or (if the device
provides the GPIO lines only conditionally) the code that creates the
device isn't configuring it correctly so it provides the expected number
of lines.

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]