public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org,
	Samu Onkalo <samu.p.onkalo@nokia.com>,
	michael.opdenacker@free-electrons.com,
	gregory.clement@free-electrons.com,
	maxime.ripard@free-electrons.com,
	alexandre.belloni@free-electrons.com
Subject: Re: [PATCH] char: misc: assign file->private_data in all cases
Date: Mon, 24 Jun 2013 15:26:42 -0700	[thread overview]
Message-ID: <20130624222642.GA24099@kroah.com> (raw)
In-Reply-To: <1371819665-3882-1-git-send-email-thomas.petazzoni@free-electrons.com>

On Fri, Jun 21, 2013 at 03:01:05PM +0200, Thomas Petazzoni wrote:
> In fa1f68db6ca ("drivers: misc: pass miscdevice pointer via file
> private data"), the misc driver infrastructure was changed to assigned
> file->private_data as a pointer to the 'struct miscdevice' that
> corresponds to the device being opened.
> 
> However, this assignment was only done when the misc driver was
> declaring a driver-specific ->open() operation in its
> file_operations. This doesn't make sense, as the driver may not
> necessarily have a custom ->open() operation, and might still be
> interested in having file->private_data properly set for use in its
> ->read() and write() operations.
> 
> Therefore, we move the assignment of file->private_data outside of the
> condition that tests whether a driver-specific ->open() operation was
> defined.

Does this solve a problem with an existing misc driver?  Or are you just
trying to be "safe" for future, broken, drivers?

thanks,

greg k-h

  parent reply	other threads:[~2013-06-24 22:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21 13:01 [PATCH] char: misc: assign file->private_data in all cases Thomas Petazzoni
2013-06-21 13:25 ` Arnd Bergmann
2013-06-24 22:26 ` Greg Kroah-Hartman [this message]
2013-06-25  9:59   ` Thomas Petazzoni

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=20130624222642.GA24099@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=arnd@arndb.de \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=michael.opdenacker@free-electrons.com \
    --cc=samu.p.onkalo@nokia.com \
    --cc=thomas.petazzoni@free-electrons.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox