Skip to content

Commit bd16168

Browse files
Alphixmchehab
authored andcommitted
[media] lirc_zilog: remove module parameter minor
Always let the kernel decide what minor the lirc chardev gets. Signed-off-by: David Härdeman <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 56481f0 commit bd16168

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

drivers/staging/media/lirc/lirc_zilog.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ static struct mutex tx_data_lock;
156156
/* module parameters */
157157
static bool debug; /* debug output */
158158
static bool tx_only; /* only handle the IR Tx function */
159-
static int minor = -1; /* minor number */
160159

161160

162161
/* struct IR reference counting */
@@ -184,10 +183,11 @@ static void release_ir_device(struct kref *ref)
184183
* ir->open_count == 0 - happens on final close()
185184
* ir_lock, tx_ref_lock, rx_ref_lock, all released
186185
*/
187-
if (ir->l.minor >= 0 && ir->l.minor < MAX_IRCTL_DEVICES) {
186+
if (ir->l.minor >= 0) {
188187
lirc_unregister_driver(ir->l.minor);
189-
ir->l.minor = MAX_IRCTL_DEVICES;
188+
ir->l.minor = -1;
190189
}
190+
191191
if (kfifo_initialized(&ir->rbuf.fifo))
192192
lirc_buffer_free(&ir->rbuf);
193193
list_del(&ir->list);
@@ -1597,12 +1597,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
15971597
}
15981598

15991599
/* register with lirc */
1600-
ir->l.minor = minor; /* module option: user requested minor number */
16011600
ir->l.minor = lirc_register_driver(&ir->l);
1602-
if (ir->l.minor < 0 || ir->l.minor >= MAX_IRCTL_DEVICES) {
1601+
if (ir->l.minor < 0) {
16031602
dev_err(tx->ir->l.dev,
1604-
"%s: \"minor\" must be between 0 and %d (%d)!\n",
1605-
__func__, MAX_IRCTL_DEVICES-1, ir->l.minor);
1603+
"%s: lirc_register_driver() failed: %i\n",
1604+
__func__, ir->l.minor);
16061605
ret = -EBADRQC;
16071606
goto out_put_xx;
16081607
}
@@ -1674,9 +1673,6 @@ MODULE_LICENSE("GPL");
16741673
/* for compat with old name, which isn't all that accurate anymore */
16751674
MODULE_ALIAS("lirc_pvr150");
16761675

1677-
module_param(minor, int, 0444);
1678-
MODULE_PARM_DESC(minor, "Preferred minor device number");
1679-
16801676
module_param(debug, bool, 0644);
16811677
MODULE_PARM_DESC(debug, "Enable debugging messages");
16821678

0 commit comments

Comments
 (0)