|
@@ -3908,8 +3908,23 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
|
|
|
* the device name as label
|
|
|
*/
|
|
|
status = gpiod_request(desc, con_id ? con_id : devname);
|
|
|
- if (status < 0)
|
|
|
- return ERR_PTR(status);
|
|
|
+ if (status < 0) {
|
|
|
+ if (status == -EBUSY && flags & GPIOD_FLAGS_BIT_NONEXCLUSIVE) {
|
|
|
+ /*
|
|
|
+ * This happens when there are several consumers for
|
|
|
+ * the same GPIO line: we just return here without
|
|
|
+ * further initialization. It is a bit if a hack.
|
|
|
+ * This is necessary to support fixed regulators.
|
|
|
+ *
|
|
|
+ * FIXME: Make this more sane and safe.
|
|
|
+ */
|
|
|
+ dev_info(dev, "nonexclusive access to GPIO for %s\n",
|
|
|
+ con_id ? con_id : devname);
|
|
|
+ return desc;
|
|
|
+ } else {
|
|
|
+ return ERR_PTR(status);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
status = gpiod_configure_flags(desc, con_id, lookupflags, flags);
|
|
|
if (status < 0) {
|