linux-mips
[Top] [All Lists]

Re: [PATCH] seq_file conversion: APM on mips

To: Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH] seq_file conversion: APM on mips
From: Pavel Machek <pavel@ucw.cz>
Date: Tue, 23 Jan 2007 14:36:14 +0000
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
In-reply-to: <20070115211413.GB5010@martell.zuzino.mipt.ru>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070115211413.GB5010@martell.zuzino.mipt.ru>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.9i
Hi!

> @@ -456,14 +456,26 @@ static int apm_get_info(char *buf, char 
>       case 1:         units = "sec";  break;
>       }
>  
> -     ret = sprintf(buf, "%s 1.2 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
> +     seq_printf(m, "%s 1.2 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
>                    driver_version, APM_32_BIT_SUPPORT,
>                    info.ac_line_status, info.battery_status,
>                    info.battery_flag, info.battery_life,
>                    info.time, units);
> +     return 0;
> +}
>  
> -     return ret;
> +static int proc_apm_open(struct inode *inode, struct file *file)
> +{
> +     return single_open(file, proc_apm_show, NULL);
>  }
> +
> +static const struct file_operations proc_apm_fops = {
> +     .owner          = THIS_MODULE,
> +     .open           = proc_apm_open,
> +     .read           = seq_read,
> +     .llseek         = seq_lseek,
> +     .release        = single_release,
> +};
>  #endif
>  
>  static int kapmd(void *arg)

Perhaps now is good time to make the code shared?

                                                        Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

<Prev in Thread] Current Thread [Next in Thread>