Skip to contentSkip to conversation

misc: bcm-vk: only support ttyVK if CONFIG_TTY is set

PATCH Superseded Scott Branden 2 participants 2 messages Jan 29, 2021

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Scott Branden

author maintainer
#0 lore raw

PATCH 1/1 misc: bcm-vk: only support ttyVK if CONFIG_TTY is set

Correct compile issue if CONFIG_TTY is not set by
only adding ttyVK devices if CONFIG_TTY is set.

---
 drivers/misc/bcm-vk/Makefile     |  4 ++--
 drivers/misc/bcm-vk/bcm_vk_dev.c | 13 +++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)
drivers/misc/bcm-vk/Makefile +2 -2
index e4a1486f7209..8d81a734fcad 100644
@@ -7,6 +7,6 @@ obj-$(CONFIG_BCM_VK) += bcm_vk.o
 bcm_vk-objs := \
 	bcm_vk_dev.o \
 	bcm_vk_msg.o \
-	bcm_vk_sg.o \
-	bcm_vk_tty.o
+	bcm_vk_sg.o
 
+bcm_vk-$(CONFIG_TTY) += bcm_vk_tty.o
drivers/misc/bcm-vk/bcm_vk_dev.c +13 -0
index c3d2bba68ef1..ae63fbdf14bc 100644
@@ -525,7 +525,10 @@ void bcm_vk_blk_drv_access(struct bcm_vk *vk)
 			}
 		}
 	}
+
+#ifdef CONFIG_TTY
 	bcm_vk_tty_terminate_tty_user(vk);
+#endif
 	spin_unlock(&vk->ctx_lock);
 }
 
@@ -1385,6 +1388,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 	vk->num_irqs++;
 
+#ifdef CONFIG_TTY
 	for (i = 0;
 	     (i < VK_MSIX_TTY_MAX) && (vk->num_irqs < irq);
 	     i++, vk->num_irqs++) {
@@ -1398,6 +1402,7 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		}
 		vk->tty[i].irq_enabled = true;
 	}
+#endif
 
 	id = ida_simple_get(&bcm_vk_ida, 0, 0, GFP_KERNEL);
 	if (id < 0) {
@@ -1451,10 +1456,12 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto err_destroy_workqueue;
 	}
 
+#ifdef CONFIG_TTY
 	snprintf(name, sizeof(name), KBUILD_MODNAME ".%d_ttyVK", id);
 	err = bcm_vk_tty_init(vk, name);
 	if (err)
 		goto err_unregister_panic_notifier;
+#endif
 
 	/*
 	 * lets trigger an auto download.  We don't want to do it serially here
@@ -1480,9 +1487,11 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	return 0;
 
 err_bcm_vk_tty_exit:
+#ifdef CONFIG_TTY
 	bcm_vk_tty_exit(vk);
 
 err_unregister_panic_notifier:
+#endif
 	atomic_notifier_chain_unregister(&panic_notifier_list,
 					 &vk->panic_nb);
 
@@ -1560,7 +1569,9 @@ static void bcm_vk_remove(struct pci_dev *pdev)
 					 &vk->panic_nb);
 
 	bcm_vk_msg_remove(vk);
+#ifdef CONFIG_TTY
 	bcm_vk_tty_exit(vk);
+#endif
 
 	if (vk->tdma_vaddr)
 		dma_free_coherent(&pdev->dev, nr_scratch_pages * PAGE_SIZE,
@@ -1580,8 +1591,10 @@ static void bcm_vk_remove(struct pci_dev *pdev)
 
 	cancel_work_sync(&vk->wq_work);
 	destroy_workqueue(vk->wq_thread);
+#ifdef CONFIG_TTY
 	cancel_work_sync(&vk->tty_wq_work);
 	destroy_workqueue(vk->tty_wq_thread);
+#endif
 
 	for (i = 0; i < MAX_BAR; i++) {
 		if (vk->bar[i])
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Scott Branden

Correct compile issue if CONFIG_TTY is not set by
only adding ttyVK devices if CONFIG_TTY is set.

---
 drivers/misc/bcm-vk/Makefile     |  4 ++--
 drivers/misc/bcm-vk/bcm_vk_dev.c | 13 +++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

Thanks.

Signature · 1 line
~Randy