Subject: Re: [PATCH v3] Create add_rtc() function to enable the RTC CMOS driver

From: Segher Boessenkool <[email-masked]>
Date: Wed, 20 Jun 2007 19:46:54 +0200

> +	/*
> +	 * RTC_PORT(x) is hardcoded in asm/mc146818rtc.h.  Verify that the
> +	 * address provided by the device node matches.
> +	 */
> +	if (res.start != RTC_PORT(0)) {
> +		of_node_put(np);
> +		return -ENODEV;
> +	}

You can place the of_node_put() here and remove the
previous one, and the following one.

> +	pd = platform_device_register_simple("rtc_cmos", -1,
> +					     &res, 1);
> +	of_node_put(np);

Code looks fine, with or without that change.

Segher