On Mon, Mar 02, 2015 at 12:38:35AM +0100, Salah Triki wrote:
> This patch removes unnecessary checks of unit magic, channel magic, board
> magic and board state.
> 
> Signed-off-by: Salah Triki <salah.tr...@acm.org>
> ---
>  drivers/staging/dgnc/dgnc_sysfs.c | 14 --------------
>  1 file changed, 14 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
> b/drivers/staging/dgnc/dgnc_sysfs.c
> index 2fd34ca..f420590 100644
> --- a/drivers/staging/dgnc/dgnc_sysfs.c
> +++ b/drivers/staging/dgnc/dgnc_sysfs.c
> @@ -384,23 +384,9 @@ void dgnc_remove_ports_sysfiles(struct dgnc_board *bd)
> 
>  static ssize_t dgnc_tty_state_show(struct device *d, struct device_attribute 
> *attr, char *buf)
>  {
> -     struct dgnc_board *bd;
> -     struct channel_t *ch;
>       struct un_t *un;
> 
> -     if (!d)
> -             return 0;
>       un = dev_get_drvdata(d);
> -     if (!un || un->magic != DGNC_UNIT_MAGIC)
> -             return 0;
> -     ch = un->un_ch;
> -     if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
> -             return 0;
> -     bd = ch->ch_bd;
> -     if (!bd || bd->magic != DGNC_BOARD_MAGIC)
> -             return 0;
> -     if (bd->state != BOARD_READY)
> -             return 0;
> 
>       return snprintf(buf, PAGE_SIZE, "%s", un->un_open_count ? "Open" : 
> "Closed");

Why do we have this sysfs file at all?  It's not useful for anything,
and userspace better not depend on learning if a tty port is "open" or
"closed" :)

Care to just remove it entirely?

thanks,

greg k-h
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to