linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] gpiolib: misc fixups
@ 2021-03-29 11:40 Matti Vaittinen
  2021-03-29 11:41 ` [PATCH 1/2] gpio: sysfs: Obey valid_mask Matti Vaittinen
  2021-03-29 11:41 ` [PATCH 2/2] gpiolib: Allow drivers to return EOPNOTSUPP from config Matti Vaittinen
  0 siblings, 2 replies; 17+ messages in thread
From: Matti Vaittinen @ 2021-03-29 11:40 UTC (permalink / raw)
  To: matti.vaittinen, mazziesaccount
  Cc: Linus Walleij, Bartosz Golaszewski, Stephen Boyd,
	Andy Shevchenko, linux-gpio, linux-kernel

Patch 1/2:
The deprecated and obsoleted - but still used (especially in older
releases) /sys/class/gpio interface allows modifying GPIOs which are
excluded by the "valid_mask". This makes the valid_mask not suitable for
cases where toggling GPIO can cause damage. Patch adds validity
check to export.

I assume many people are still using the /sys/class/gpio at least for
testing purposes - especially with older releases. Thus it might be
worth the hassle to exclude invalid GPIOs - they're probably set invalid
for a good reason. (Actually, I noticed this when trying to use the
valid_mask to invalidate undocumented GPO on BD71815 - which may be
connected to GND. The people using BD71815 are likely to be using some
stable-release, which probably supports the (deprected, obsolete) sysfs
until the end of the days => valid_mask is not safe way unless fix to
this is backported to stable).

Patch 2/2:
checkpatch nowadays reminds us that ENOTSUPP is not valid error and
should be replaced by EOPNOTSUPP. It'd be nice if GPIO drivers could
return also the EOPNOTSUPP from config and avoid being nagged by
checkpatch.

Matti Vaittinen (2):
  gpio: sysfs: Obey valid_mask
  gpiolib: Allow drivers to return EOPNOTSUPP from config

 drivers/gpio/gpiolib-sysfs.c | 8 ++++++++
 drivers/gpio/gpiolib.c       | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.25.4


-- 
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-04-01  3:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 11:40 [PATCH 0/2] gpiolib: misc fixups Matti Vaittinen
2021-03-29 11:41 ` [PATCH 1/2] gpio: sysfs: Obey valid_mask Matti Vaittinen
2021-03-29 11:56   ` Andy Shevchenko
2021-03-31  7:56   ` Bartosz Golaszewski
2021-03-31 12:25     ` Andy Shevchenko
2021-03-31 18:29       ` Bartosz Golaszewski
2021-04-01  3:56         ` Matti Vaittinen
2021-03-29 11:41 ` [PATCH 2/2] gpiolib: Allow drivers to return EOPNOTSUPP from config Matti Vaittinen
2021-03-29 11:59   ` Andy Shevchenko
2021-03-29 12:20     ` Matti Vaittinen
2021-03-29 13:30       ` Andy Shevchenko
2021-03-30  4:32         ` Matti Vaittinen
2021-03-30 10:19           ` Andy Shevchenko
2021-03-31  8:10           ` Bartosz Golaszewski
2021-03-29 15:08     ` Joe Perches
2021-03-29 15:25       ` Andy Shevchenko
2021-03-29 17:46         ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).