#include <linux/module.h>
#include <linux/slab.h>
#include <linux/gpio.h>
-#include <linux/gpio/driver.h>
+#include <linux/gpio.h>
#include "greybus.h"
struct gb_gpio_device {
void gb_gpio_disconnect(struct greybus_device *gdev)
{
struct gb_gpio_device *gb_gpio_dev;
+ int retval;
gb_gpio_dev = gdev->gb_gpio_dev;
- gpiochip_remove(&gb_gpio_dev->chip);
+ retval = gpiochip_remove(&gb_gpio_dev->chip);
kfree(gb_gpio_dev);
}
--- /dev/null
+/*
+ * Greybus kernel "version" glue logic.
+ *
+ * Copyright 2014 Google Inc.
+ *
+ * Released under the GPLv2 only.
+ *
+ * Backports of newer kernel apis to allow the code to build properly on older
+ * kernel versions. Remove this file when merging to upstream, it should not be
+ * needed at all
+ */
+
+#ifndef __GREYBUS_KERNEL_VER_H
+#define __GREYBUS_KERNEL_VER_H
+
+#ifndef DEVICE_ATTR_RO
+#define DEVICE_ATTR_RO(_name) \
+ struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
+#endif
+
+
+#endif /* __GREYBUS_KERNEL_VER_H */