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

Commit f5d9c57b authored by Zijun Hu's avatar Zijun Hu Committed by Gerrit - the friendly Code Review server
Browse files

bluetooth: Fix build failure when CONFIG_BTFM_SLIM is not defined



Fix build error when CONFIG_MSM_BT_POWER is defined but
CONFIG_BTFM_SLIM is *not* defined.

CRs-Fixed: 2399342
Change-Id: Iafabf440f62537410e41fbf53f039e0e229d49af
Signed-off-by: default avatarZijun Hu <zijuhu@codeaurora.org>
parent b55100db
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -32,7 +32,10 @@
#include <net/cnss.h>
#endif

#ifdef CONFIG_BTFM_SLIM
#include "btfm_slim.h"
#endif

#include <linux/fs.h>

#define BT_PWR_DBG(fmt, arg...)  pr_debug("%s: " fmt "\n", __func__, ## arg)
@@ -675,6 +678,7 @@ static long bt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
	int chipset_version = 0;

	switch (cmd) {
#ifdef CONFIG_BTFM_SLIM
	case BT_CMD_SLIM_TEST:
		if (!bt_power_pdata->slim_dev) {
			BT_PWR_ERR("slim_dev is null\n");
@@ -684,6 +688,7 @@ static long bt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
			bt_power_pdata->slim_dev->platform_data
		);
		break;
#endif
	case BT_CMD_PWR_CTRL:
		pwr_cntrl = (int)arg;
		BT_PWR_ERR("BT_CMD_PWR_CTRL pwr_cntrl:%d", pwr_cntrl);
@@ -737,20 +742,20 @@ static int __init bluetooth_power_init(void)

	bt_major = register_chrdev(0, "bt", &bt_dev_fops);
	if (bt_major < 0) {
		BTFMSLIM_ERR("failed to allocate char dev\n");
		BT_PWR_ERR("failed to allocate char dev\n");
		goto chrdev_unreg;
	}

	bt_class = class_create(THIS_MODULE, "bt-dev");
	if (IS_ERR(bt_class)) {
		BTFMSLIM_ERR("coudn't create class");
		BT_PWR_ERR("coudn't create class");
		goto chrdev_unreg;
	}


	if (device_create(bt_class, NULL, MKDEV(bt_major, 0),
		NULL, "btpower") == NULL) {
		BTFMSLIM_ERR("failed to allocate char dev\n");
		BT_PWR_ERR("failed to allocate char dev\n");
		goto chrdev_unreg;
	}
	return 0;