Commit 717fca7a authored by Alessandro Rubini's avatar Alessandro Rubini

spec-fmc: do not verify GPIO open drain and open source bits

These bits were intruced in Linux-3.3, so don't refer to them.
Rather, err out on all unimplemented bits.  This is a different
patch from what David suggested.
Reported-by: Juan David González Cobas's avatarJuan David Gonzalez Cobas <dcobas@cern.ch>
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent b09263f3
......@@ -170,12 +170,14 @@ static int spec_map_pin(int virtual)
static int spec_cfg_pin(struct fmc_device *fmc, int pin, int mode, int imode)
{
struct spec_dev *spec = fmc->carrier_data;
int valid_bits = GPIOF_DIR_IN | GPIOF_DIR_OUT
| GPIOF_INIT_HIGH | GPIOF_INIT_LOW;
int ret = 0;
int bit = (1 << pin);
if (pin < 0 || pin > 15)
return -ENODEV;
if (mode & (GPIOF_OPEN_DRAIN |GPIOF_OPEN_SOURCE))
if (mode & ~valid_bits)
return -EINVAL;
if (mode & GPIOF_DIR_IN) {
/* 1 = input */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment