Thread (1 message) 1 message, 1 author, 2017-02-21
DORMANTno replies

[rtc-linux] [PATCH 05/14] tpm-chip: utilize new device_add_cdev helper function

From: Logan Gunthorpe <logang@deltatee.com>
Date: 2017-02-21 05:00:44
Also in: linux-fsdevel, linux-gpio, linux-input, linux-rdma, linux-scsi, nvdimm
Subsystem: the rest, tpm device driver · Maintainers: Linus Torvalds, Peter Huewe, Jarkko Sakkinen

Possibly related (same subject, not in this thread)

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
---
 drivers/char/tpm/tpm-chip.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index a77262d..dc90b45 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -187,7 +187,6 @@ struct tpm_chip *tpm_chip_alloc(struct device *dev,
 
 	cdev_init(&chip->cdev, &tpm_fops);
 	chip->cdev.owner = THIS_MODULE;
-	chip->cdev.kobj.parent = &chip->dev.kobj;
 
 	return chip;
 
@@ -230,7 +229,7 @@ static int tpm_add_char_device(struct tpm_chip *chip)
 {
 	int rc;
 
-	rc = cdev_add(&chip->cdev, chip->dev.devt, 1);
+	rc = device_add_cdev(&chip->dev, &chip->cdev);
 	if (rc) {
 		dev_err(&chip->dev,
 			"unable to cdev_add() %s, major %d, minor %d, err=%d\n",
-- 
2.1.4

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help