Re: [PATCH v2 13/23] counter: Provide alternative counter registration functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/28/21 20:00, Jonathan Cameron wrote:
On Mon, 27 Dec 2021 10:45:16 +0100
Uwe Kleine-König         <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
+	if (err < 0)
+		goto err_chrdev_add;
+
+	device_initialize(dev);
+	/* Configure device structure for Counter */
+	dev->type = &counter_device_type;
+	dev->bus = &counter_bus_type;
+	dev->devt = MKDEV(MAJOR(counter_devt), id);

As 0-day pointed out id not initialized.

This was the reason why second counter instance initialization failed for me when testing the patch 17. I fixed it locally by changing the line a few rows above the MKDEV():

-	dev->id = err;
+	dev->id = id = err;



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux