Re: [PATCH v2] rtc: Add MOXA ART RTC driver

From: Mark Brown
Date: Thu Jul 11 2013 - 12:52:10 EST


On Thu, Jul 11, 2013 at 03:51:51PM +0200, Jonas Jensen wrote:
> Add RTC driver for MOXA ART SoCs.

Looks good now. A couple more minor nits.

> +void moxart_rtc_write_byte(u8 data)
> +{

> +u8 moxart_rtc_read_byte(void)
> +{

These should be static.

> + gpio_direction_output(GPIO_RTC_DATA, 0);
> + gpio_set_value(GPIO_RTC_RESET, 1);

I guess I'd expect the GPIOs to be configured by platform data in case
of board changes (it's a bit odd that a SoC RTC is being done with
bitbanging, I guess it's on an external chip?).

> + devm_gpio_request(&pdev->dev, GPIO_RTC_DATA, "rtc_data");
> + devm_gpio_request(&pdev->dev, GPIO_RTC_SCLK, "rtc_sclk");
> + devm_gpio_request(&pdev->dev, GPIO_RTC_RESET, "rtc_reset");

Should check the errors from these.

> + gpio_direction_output(GPIO_RTC_RESET, 0);
> + gpio_direction_output(GPIO_RTC_SCLK, 0);

devm_gpio_request_one()? Though it doesn't make much difference and you
do have a nice block of devm_gpio_request() above not all of which have
a direction assigned immediately.

Attachment: signature.asc
Description: Digital signature