All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	Alexander Usyskin <alexander.usyskin@intel.com>
Subject: Re: [char-misc-next 1/3] mei: move from misc to char device
Date: Tue, 27 May 2014 14:20:19 -0700	[thread overview]
Message-ID: <20140527212019.GA26089@kroah.com> (raw)
In-Reply-To: <1399969321-6512-2-git-send-email-tomas.winkler@intel.com>

On Tue, May 13, 2014 at 11:21:59AM +0300, Tomas Winkler wrote:
> From: Alexander Usyskin <alexander.usyskin@intel.com>
> 
> We need to support more then one mei interface
> hence the simple misc devices is not longer an option.
> We use char device now with to not break application
> space we preserve /dev/mei for the first interface.
> 
> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
>  drivers/misc/mei/main.c    | 98 +++++++++++++++++++++++++++++++++-------------
>  drivers/misc/mei/mei_dev.h |  7 ++++
>  drivers/misc/mei/pci-me.c  |  1 -
>  3 files changed, 78 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
> index 66f0a1a..c58e059 100644
> --- a/drivers/misc/mei/main.c
> +++ b/drivers/misc/mei/main.c
> @@ -32,7 +32,6 @@
>  #include <linux/compat.h>
>  #include <linux/jiffies.h>
>  #include <linux/interrupt.h>
> -#include <linux/miscdevice.h>
>  
>  #include <linux/mei.h>
>  
> @@ -49,19 +48,12 @@
>   */
>  static int mei_open(struct inode *inode, struct file *file)
>  {
> -	struct miscdevice *misc = file->private_data;
> -	struct pci_dev *pdev;
>  	struct mei_cl *cl;
>  	struct mei_device *dev;
>  
>  	int err;
>  
> -	if (!misc->parent)
> -		return -ENODEV;
> -
> -	pdev = container_of(misc->parent, struct pci_dev, dev);
> -
> -	dev = pci_get_drvdata(pdev);
> +	dev = container_of(inode->i_cdev, struct mei_device, cdev);
>  	if (!dev)
>  		return -ENODEV;
>  
> @@ -667,26 +659,48 @@ static const struct file_operations mei_fops = {
>  	.llseek = no_llseek
>  };
>  
> -/*
> - * Misc Device Struct
> - */
> -static struct miscdevice  mei_misc_device = {
> -		.name = "mei",
> -		.fops = &mei_fops,
> -		.minor = MISC_DYNAMIC_MINOR,
> -};
> -
> +static struct class *mei_class;
> +static dev_t mei_devt;
> +#define MAX_MEI_DEVS 5            /* Maximum number of mei devices */

Why have a max number at all?

>  
>  int mei_register(struct mei_device *dev)
>  {
> -	int ret;
> -	mei_misc_device.parent = &dev->pdev->dev;
> -	ret = misc_register(&mei_misc_device);
> -	if (ret)
> +
> +	int ret, devno;
> +	int id = 0; /* FIXME: retrieve interface version*/

You still are only allocating 1 mei device, so why do all of this work
at all?  Nothing changes, so why should I accept this patch?

greg k-h


  reply	other threads:[~2014-05-27 21:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  8:21 [char-misc-next 0/3] mei support more devices Tomas Winkler
2014-05-13  8:21 ` [char-misc-next 1/3] mei: move from misc to char device Tomas Winkler
2014-05-27 21:20   ` Greg KH [this message]
2014-05-13  8:22 ` [char-misc-next 2/3] mei: sysfs: add Documentation mei class attributes Tomas Winkler
2014-05-13  8:22 ` [char-misc-next 3/3] mei: add WPT second mei interface Tomas Winkler
2014-05-27 21:22   ` Greg KH
2014-05-27 21:42     ` Winkler, Tomas
2014-05-27 22:06       ` Greg KH
2014-05-27 23:47         ` Winkler, Tomas
2014-05-28  0:35           ` Greg KH

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=20140527212019.GA26089@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.usyskin@intel.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomas.winkler@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.