Re: [PATCH] Platform real time clock driver for Dallas 1511 chip.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 4 Dec 2007 16:46:51 -0800, Andrew Sharp <[email protected]> wrote:
> +struct rtc_plat_data {
> +	struct rtc_device *rtc;
> +	void __iomem *ioaddr;		/* virtual base address */
> +	unsigned long baseaddr;		/* physical base address */
> +	int size;				/* amount of memory mapped */
> +	int irq;
> +	unsigned int irqen;
> +	int alrm_sec;
> +	int alrm_min;
> +	int alrm_hour;
> +	int alrm_mday;
> +};
> +
> +static DEFINE_SPINLOCK(ds1511_lock);
> +
> +static __iomem char *ds1511_base;

If you used ds1511_base, ioaddr in rtc_plat_data is not needed.

> + static noinline void
> +rtc_write(uint8_t val, uint32_t reg)
> +{
> +	writeb(val, ds1511_base + (reg * reg_spacing));
> +}

Still "noinline" here and there.

> +static struct bin_attribute ds1511_nvram_attr = {
> +	.attr = {
> +		.name = "nvram",
> +		.mode = S_IRUGO | S_IWUGO,
> +		.owner = THIS_MODULE,
> +	},
> +	.size = DS1511_RAM_MAX,
> +	.read = ds1511_nvram_read,
> +	.write = ds1511_nvram_write,
> +};

It would be better to use S_IWUSR instead of S_IWUGO.  Please check
rtc-ds1553 changes in current git tree.

> +static struct platform_driver ds1511_rtc_driver = {
> +	.probe		= ds1511_rtc_probe,
> +	.remove		= __devexit_p(ds1511_rtc_remove),
> +	.driver		= {
> +		.name	= "ds1511",
> +		.owner	= THIS_MODULE,
> +	},
> +};

Use "rtc-ds1511" for driver name for hotplugging.  Please check
rtc-ds1553 changes in current git tree.

> + static void __exit
> +ds1511_rtc_exit(void)
> +{
> +	return platform_driver_unregister(&ds1511_rtc_driver);
> +}

Do not return void value.  Please check rtc-ds1553 changes in current
git tree.

---
Atsushi Nemoto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux