Commit 7f4c9bc2 authored by Bumwoo Lee's avatar Bumwoo Lee Committed by Chanwoo Choi
Browse files

extcon: Remove redundant null checking for class



create_extcon_class() is already Null checking.

Signed-off-by: default avatarBumwoo Lee <bw365.lee@samsung.com>
Acked-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent c95fb88f
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -1012,12 +1012,13 @@ ATTRIBUTE_GROUPS(extcon);

static int create_extcon_class(void)
{
	if (!extcon_class) {
	if (extcon_class)
		return 0;

	extcon_class = class_create("extcon");
	if (IS_ERR(extcon_class))
		return PTR_ERR(extcon_class);
	extcon_class->dev_groups = extcon_groups;
	}

	return 0;
}
@@ -1088,11 +1089,9 @@ int extcon_dev_register(struct extcon_dev *edev)
	int ret, index = 0;
	static atomic_t edev_no = ATOMIC_INIT(-1);

	if (!extcon_class) {
	ret = create_extcon_class();
	if (ret < 0)
		return ret;
	}

	if (!edev || !edev->supported_cable)
		return -EINVAL;