[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110528212347.GA11303@suse.de>
Date: Sun, 29 May 2011 05:23:47 +0800
From: Greg KH <gregkh@...e.de>
To: Chris Metcalf <cmetcalf@...era.com>
Cc: linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Eric Biederman <ebiederm@...stanetworks.com>,
Chris Wright <chrisw@...s-sol.org>,
Benjamin Thery <benjamin.thery@...l.net>,
Phil Carmody <ext-phil.2.carmody@...ia.com>
Subject: Re: [PATCH v2] arch/tile: add hypervisor-based character driver for
SPI flash ROM
On Sat, May 28, 2011 at 11:13:54AM -0400, Chris Metcalf wrote:
> --- /dev/null
> +++ b/drivers/char/tile-srom.c
> @@ -0,0 +1,453 @@
> +/*
> + * Copyright 2011 Tilera Corporation. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation, version 2.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
> + * NON INFRINGEMENT. See the GNU General Public License for
> + * more details.
> + *
> + * SPI Flash ROM driver
> + *
> + * This source code is derived from code provided in "Linux Device
> + * Drivers" by Alessandro Rubini and Jonathan Corbet, published by
> + * O'Reilly & Associates.
> + */
LDD version 2? Wow, this driver is old.
> +MODULE_LICENSE("Dual BSD/GPL");
Wait, where did the BSD come from? You just said it was GPL only above
in the header of the file?
> +/**
> + * srom_setup_cdev() - Set up a device instance in the cdev table.
> + * @dev: Per-device SROM state.
> + * @index: Device to set up.
> + */
> +static void srom_setup_cdev(struct srom_dev *dev, int index)
> +{
> + int err, devno = MKDEV(srom_major, index);
> +
> + cdev_init(&dev->cdev, &srom_fops);
> + dev->cdev.owner = THIS_MODULE;
> + dev->cdev.ops = &srom_fops;
> + err = cdev_add(&dev->cdev, devno, 1);
> + /* Fail gracefully if need be */
> + if (err)
> + pr_notice("Error %d adding srom%d", err, index);
> +}
As you are only using 1 minor device, why not just use a misc device
instead? It's simpler, and you get the sysfs code for free, which you
forgot to do, so your device node will never show up in userspace :(
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists