linux-mips
[Top] [All Lists]

Re: [PATCH] seq_file conversion: APM on mips

To: "Pavel Machek" <pavel@ucw.cz>
Subject: Re: [PATCH] seq_file conversion: APM on mips
From: "Alexey Dobriyan" <adobriyan@gmail.com>
Date: Wed, 24 Jan 2007 16:50:34 +0300
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LdDXdkdBVLeY/iazLf8lEXDggagYYyG8O+rple/TXaX22J7WjHSVmli85CHpL9IOjmjOBsmers4L6EMqDT6MEIeb2FdyAHTfgpYoTEYIqekcVI7clNrfLi3/Px/67lj9eNfvS2V9+Gah5tsa5bmPzojOJ7vqhugL2dN6SykuVNE=
In-reply-to: <20070123143614.GA6596@ucw.cz>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070115211413.GB5010@martell.zuzino.mipt.ru> <20070123143614.GA6596@ucw.cz>
Sender: linux-mips-bounce@linux-mips.org
On 1/23/07, Pavel Machek <pavel@ucw.cz> wrote:
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?

Well, my intention was to remove last ->get_info users and
remove struct proc_dir_entry::get_info altogether.

I didn't know about APM merging efforts.

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