Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 449a2bf5 authored by MyungJoo Ham's avatar MyungJoo Ham Committed by Greg Kroah-Hartman
Browse files

Remove "switch" class in drivers/staging/android/switch



Because extcon can also be a switch class for legacy userspace (Android)
and is a superset of switch class in drivers/staging/android/switch,
switch class may be removed.

- Remove switch class
- Remove switch class consideration in extcon class

Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3e971dbc
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -65,9 +65,9 @@ const char *extcon_cable_name[] = {
};

struct class *extcon_class;
#if defined(CONFIG_ANDROID) && !defined(CONFIG_ANDROID_SWITCH)
#if defined(CONFIG_ANDROID)
static struct class_compat *switch_class;
#endif /* CONFIG_ANDROID && !defined(CONFIG_ANDROID_SWITCH) */
#endif /* CONFIG_ANDROID */

static LIST_HEAD(extcon_dev_list);
static DEFINE_MUTEX(extcon_dev_list_lock);
@@ -532,11 +532,11 @@ static int create_extcon_class(void)
			return PTR_ERR(extcon_class);
		extcon_class->dev_attrs = extcon_attrs;

#if defined(CONFIG_ANDROID) && !defined(CONFIG_ANDROID_SWITCH)
#if defined(CONFIG_ANDROID)
		switch_class = class_compat_register("switch");
		if (WARN(!switch_class, "cannot allocate"))
			return -ENOMEM;
#endif /* CONFIG_ANDROID && !defined(CONFIG_ANDROID_SWITCH) */
#endif /* CONFIG_ANDROID */
	}

	return 0;
@@ -749,11 +749,11 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
		put_device(edev->dev);
		goto err_dev;
	}
#if defined(CONFIG_ANDROID) && !defined(CONFIG_ANDROID_SWITCH)
#if defined(CONFIG_ANDROID)
	if (switch_class)
		ret = class_compat_create_link(switch_class, edev->dev,
					       dev);
#endif /* CONFIG_ANDROID && !defined(CONFIG_ANDROID_SWITCH) */
#endif /* CONFIG_ANDROID */

	spin_lock_init(&edev->lock);

+0 −3
Original line number Diff line number Diff line
@@ -52,8 +52,6 @@ config ANDROID_LOW_MEMORY_KILLER
	---help---
	  Register processes to be killed when memory is low

source "drivers/staging/android/switch/Kconfig"

config ANDROID_INTF_ALARM
	bool "Android alarm driver"
	depends on RTC_CLASS
@@ -79,7 +77,6 @@ config ANDROID_ALARM_OLDDRV_COMPAT
	  Provides preprocessor alias to aid compatability with
	  older out-of-tree drivers that use the Android Alarm
	  in-kernel API. This will be removed eventually.

endif # if ANDROID

endmenu
+0 −1
Original line number Diff line number Diff line
@@ -6,6 +6,5 @@ obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o
obj-$(CONFIG_ANDROID_TIMED_OUTPUT)	+= timed_output.o
obj-$(CONFIG_ANDROID_TIMED_GPIO)	+= timed_gpio.o
obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER)	+= lowmemorykiller.o
obj-$(CONFIG_ANDROID_SWITCH)		+= switch/
obj-$(CONFIG_ANDROID_INTF_ALARM)	+= alarm.o
obj-$(CONFIG_ANDROID_INTF_ALARM_DEV)	+= alarm-dev.o
+0 −11
Original line number Diff line number Diff line
menuconfig ANDROID_SWITCH
	tristate "Android Switch class support"
	help
	  Say Y here to enable Android switch class support. This allows
	  monitoring switches by userspace via sysfs and uevent.

config ANDROID_SWITCH_GPIO
	tristate "Android GPIO Switch support"
	depends on GENERIC_GPIO && ANDROID_SWITCH
	help
	  Say Y here to enable GPIO based switch support.
+0 −4
Original line number Diff line number Diff line
# Android Switch Class Driver
obj-$(CONFIG_ANDROID_SWITCH)		+= switch_class.o
obj-$(CONFIG_ANDROID_SWITCH_GPIO)	+= switch_gpio.o
Loading