From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750858AbdEEQi4 (ORCPT ); Fri, 5 May 2017 12:38:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47936 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750747AbdEEQiz (ORCPT ); Fri, 5 May 2017 12:38:55 -0400 Date: Fri, 5 May 2017 09:38:46 -0700 From: Greg KH To: James Bottomley Cc: Linus Torvalds , Jarkko Sakkinen , Andrew Morton , Arnd Bergmann , Linux Kernel Mailing List Subject: Re: [GIT PULL] Char/Misc driver patches for 4.12-rc1 Message-ID: <20170505163846.GA31211@kroah.com> References: <20170505001808.GA16769@kroah.com> <1494000006.2399.7.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1494000006.2399.7.camel@HansenPartnership.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 05, 2017 at 09:00:06AM -0700, James Bottomley wrote: > On Thu, 2017-05-04 at 19:28 -0700, Linus Torvalds wrote: > > On Thu, May 4, 2017 at 5:18 PM, Greg KH > > wrote: > > > > > > Here is the big set of new char/misc driver drivers and features > > > for 4.12-rc1. > > > > Ugh. I'm not particularly happy with the conflicts I got and my > > resolutions there-of. > > Yes, we really should have done this via a postmerge tree. We've had > so little cause to use them recently, I suspect everyone's forgotten > how. Huh? You could have pulled in my tree into this one, or I could have done that for you, my trees are not rebased at all, and they get used this way every other release or so for this very reason. > > James, Jarkko, you need to look at that tpm merge of mine. And James, > > double-check my osd_uld thing too. > > I'm not going to defend the earlier coding, but you've lost the real > device_add() calls in the merge, meaning the tpm devices don't actually > get made visible at all. I suspect assuming device_add() is done by > cdev_device_add() because of the name is going to be our next anti > -pattern, so you're at least ahead of the game ... It's not an anti-pattern at all, it is ment to fix the bugs you, and others, keep making :) > @@ -272,24 +272,30 @@ EXPORT_SYMBOL_GPL(tpmm_chip_alloc); > static int tpm_add_char_device(struct tpm_chip *chip) > { > int rc; > + const char *errstr; > + struct device *errdev = &chip->dev; > > rc = cdev_device_add(&chip->cdev, &chip->dev); > if (rc) { > - dev_err(&chip->dev, > - "unable to cdev_device_add() %s, major %d, minor %d, err=%d\n", > - dev_name(&chip->dev), MAJOR(chip->dev.devt), > - MINOR(chip->dev.devt), rc); > - return rc; > + errstr = "cdev_device_add for main device"; > + goto error1; > + } > + rc = device_add(&chip->dev); Not to pile on, but as Linus said, this is totally wrong. Did you test it? chip->dev is already registered at this point in time... thanks, greg k-h