All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Gromm <christian.gromm@microchip.com>
To: gregkh@linuxfoundation.org
Cc: Christian Gromm <christian.gromm@microchip.com>,
	driverdev-devel@linuxdriverproject.org
Subject: [PATCH 12/28] staging: most: i2c: remove redundant is_open
Date: Tue, 8 May 2018 11:45:00 +0200	[thread overview]
Message-ID: <1525772716-15742-13-git-send-email-christian.gromm@microchip.com> (raw)
In-Reply-To: <1525772716-15742-1-git-send-email-christian.gromm@microchip.com>

The variable is_open is checked only in the work function
pending_rx_work() that is only active between the calls
configure_channel() and poison_channel().

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
 drivers/staging/most/i2c/i2c.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c
index 39b1590..8edced9 100644
--- a/drivers/staging/most/i2c/i2c.c
+++ b/drivers/staging/most/i2c/i2c.c
@@ -39,7 +39,6 @@ module_param(scan_rate, int, 0644);
 MODULE_PARM_DESC(scan_rate, "Polling rate in times/sec. Default = 100");
 
 struct hdm_i2c {
-	bool is_open[NUM_CHANNELS];
 	bool polling_mode;
 	struct most_interface most_iface;
 	struct most_channel_capability capabilities[NUM_CHANNELS];
@@ -79,7 +78,6 @@ static int configure_channel(struct most_interface *most_iface,
 	unsigned int delay, pr;
 
 	BUG_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);
-	BUG_ON(dev->is_open[ch_idx]);
 
 	if (channel_config->data_type != MOST_CH_CONTROL) {
 		pr_err("bad data type for channel %d\n", ch_idx);
@@ -113,7 +111,6 @@ static int configure_channel(struct most_interface *most_iface,
 			pr_info("polling rate is %u Hz\n", pr);
 		}
 	}
-	dev->is_open[ch_idx] = true;
 
 	return 0;
 }
@@ -136,7 +133,6 @@ static int enqueue(struct most_interface *most_iface,
 	int ret;
 
 	BUG_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);
-	BUG_ON(!dev->is_open[ch_idx]);
 
 	if (ch_idx == CH_RX) {
 		/* RX */
@@ -184,9 +180,6 @@ static int poison_channel(struct most_interface *most_iface,
 	struct mbo *mbo;
 
 	BUG_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);
-	BUG_ON(!dev->is_open[ch_idx]);
-
-	dev->is_open[ch_idx] = false;
 
 	if (ch_idx == CH_RX) {
 		if (!dev->polling_mode)
@@ -269,7 +262,7 @@ static void pending_rx_work(struct work_struct *work)
 	do_rx_work(dev);
 
 	if (dev->polling_mode) {
-		if (dev->is_open[CH_RX] && scan_rate)
+		if (scan_rate)
 			schedule_delayed_work(&dev->rx.dwork, dev->rx.delay);
 	} else {
 		dev->rx.int_disabled = false;
@@ -329,7 +322,6 @@ static int i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		 client->adapter->nr, client->addr);
 
 	for (i = 0; i < NUM_CHANNELS; i++) {
-		dev->is_open[i] = false;
 		dev->capabilities[i].data_type = MOST_CH_CONTROL;
 		dev->capabilities[i].num_buffers_packet = MAX_BUFFERS_CONTROL;
 		dev->capabilities[i].buffer_size_packet = MAX_BUF_SIZE_CONTROL;
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-05-08  9:46 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08  9:44 [PATCH 00/28] staging: most: fix issues Christian Gromm
2018-05-08  9:44 ` [PATCH 01/28] staging: most: allocate only all requested memory Christian Gromm
2018-05-09 13:19   ` Dan Carpenter
2018-05-09 14:09     ` Christian Gromm
2018-05-09 14:54       ` Dan Carpenter
2018-05-09 15:18         ` Christian Gromm
2018-05-09 15:29           ` Greg KH
2018-05-11  7:36             ` Christian Gromm
2018-05-08  9:44 ` [PATCH 02/28] staging: most: dim2: remove clock speed processing from the HDM Christian Gromm
2018-05-08  9:44 ` [PATCH 03/28] staging: most: i2c: prevent division by zero Christian Gromm
2018-05-08  9:44 ` [PATCH 04/28] staging: most: i2c: remove unnecessary poison_channel call Christian Gromm
2018-05-08  9:44 ` [PATCH 05/28] staging: most: add channel property dbr_size Christian Gromm
2018-05-08  9:44 ` [PATCH 06/28] staging: most: aim-sound: add flexible format support Christian Gromm
2018-05-08  9:44 ` [PATCH 07/28] staging: most: i2c: shorten lifetime of IRQ handler Christian Gromm
2018-05-08  9:44 ` [PATCH 08/28] staging: most: i2c: do not wait in work function Christian Gromm
2018-05-08  9:44 ` [PATCH 09/28] staging: most: i2c: avoid polling in case of misconfig Christian Gromm
2018-05-09 13:46   ` Dan Carpenter
2018-05-09 14:20     ` Christian Gromm
2018-05-08  9:44 ` [PATCH 10/28] staging: most: i2c: prevent zero delay polling Christian Gromm
2018-05-08  9:44 ` [PATCH 11/28] staging: most: i2c: trace real polling rate Christian Gromm
2018-05-08  9:45 ` Christian Gromm [this message]
2018-05-08  9:45 ` [PATCH 13/28] staging: most: i2c: remove redundant list_mutex Christian Gromm
2018-05-08  9:45 ` [PATCH 14/28] staging: most: i2c: reduce parameters inconsistency Christian Gromm
2018-05-08  9:45 ` [PATCH 15/28] staging: most: make interface drivers allocate coherent memory Christian Gromm
2018-05-08  9:45 ` [PATCH 16/28] staging: most: sound: call snd_card_new with struct device Christian Gromm
2018-05-08  9:45 ` [PATCH 17/28] staging: most: cdev: avoid warning about potentially uninitialized variable Christian Gromm
2018-05-08  9:45 ` [PATCH 18/28] staging: most: cdev: fix chrdev_region leak Christian Gromm
2018-05-08  9:45 ` [PATCH 19/28] staging: most: usb: add ep number to log Christian Gromm
2018-05-08  9:45 ` [PATCH 20/28] staging: most: cdev: fix function return value Christian Gromm
2018-05-08  9:45 ` [PATCH 21/28] staging: most: dim2: fix startup sequence Christian Gromm
2018-05-08  9:45 ` [PATCH 22/28] staging: most: cdev: fix race condition Christian Gromm
2018-05-08  9:45 ` [PATCH 23/28] staging: most: dim2: use device tree Christian Gromm
2021-10-12 18:14   ` Geert Uytterhoeven
2021-10-13 12:24     ` Greg KH
2018-05-08  9:45 ` [PATCH 24/28] staging: most: dim2: read clock speed from the device Christian Gromm
2018-05-08  9:45 ` [PATCH 25/28] staging: most: dim2: use device to allocate coherent memory Christian Gromm
2018-05-08  9:45 ` [PATCH 26/28] staging: most: usb: don't set URB_ZERO_PACKET flag for synchronous data Christian Gromm
2018-05-08  9:45 ` [PATCH 27/28] staging: most: usb: fix usb_disconnect race condition Christian Gromm
2018-05-08  9:45 ` [PATCH 28/28] staging: most: usb: remove local variable Christian Gromm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1525772716-15742-13-git-send-email-christian.gromm@microchip.com \
    --to=christian.gromm@microchip.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.