Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1410338
| From | Lars-Peter Clausen <lars@metafoo.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC 6/7] iio: Refuse to register triggers with duplicate names |
| Date | 2016-05-31 16:10 +0200 |
| Message-ID | <rESwO-3JM-11@gated-at.bofh.it> (permalink) |
| References | <rC35n-13f-3@gated-at.bofh.it> <rC35o-13f-11@gated-at.bofh.it> <rEeSK-24h-19@gated-at.bofh.it> <rEuXv-4l7-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 05/30/2016 02:49 PM, Crestez Dan Leonard wrote: > On 05/29/2016 10:48 PM, Jonathan Cameron wrote: >> On 23/05/16 19:40, Crestez Dan Leonard wrote: >>> The trigger name is documented as unique but drivers are currently >>> allowed to register triggers with duplicate names. This should be >>> considered a bug since it makes the 'current_trigger' interface >>> unusable. >>> >>> Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com> >> This feels like the right approach to my mind (and should have been there >> all along - oops). >> >> However, we do need to avoid breaking userspace. It's ugly but for those 3 drivers >> can we assume that using more than one on a board was impossible before this series >> and as such play a slight game in which we don't change the trigger name they >> are exporting, unless that name is already in use? >> >> It's ugly but it gets us the nicest solution for all drivers for a bit of ugly in >> 3 of them... > > How would that look like? I guess I could handle -EEXIST from > iio_trigger_register and try again with another name? Unfortunately the > name is initialized at alloc time while uniqueness can only be checked > at register time. This would require some refactoring in drivers for > devices I don't have. > > An alternative would be to just submit patches 4/5 and only give a > warning when non-unique trigger names are used. After all, iio device > names are not unique, the easy way would be to give up on this guarantee > for trigger names as well. > I'd say apply this patch keep things as they are in the drivers and if somebody creates a board with more than one of those devices let them come up with a fix.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[RFC 6/7] iio: Refuse to register triggers with duplicate names Crestez Dan Leonard <leonard.crestez@intel.com> - 2016-05-23 20:50 +0200
Re: [RFC 6/7] iio: Refuse to register triggers with duplicate names Jonathan Cameron <jic23@kernel.org> - 2016-05-29 21:50 +0200
Re: [RFC 6/7] iio: Refuse to register triggers with duplicate names Crestez Dan Leonard <leonard.crestez@intel.com> - 2016-05-30 15:00 +0200
Re: [RFC 6/7] iio: Refuse to register triggers with duplicate names Lars-Peter Clausen <lars@metafoo.de> - 2016-05-31 16:10 +0200
csiph-web