Re: [PATCH 2/2] Add two architectures which can detect the reset source

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

 



Marc Kleine-Budde wrote:
> [...]
> > +static int s3c_detect_reset_source(void)
> > +{
> > +	u32 reg = readl(S3C_GPIO_BASE + S3C2440_GSTATUS2);
> > +
> > +	if (reg & S3C2440_GSTATUS2_PWRST) {
> > +		set_reset_source(RESET_POR);
> > +		writel(S3C2440_GSTATUS2_PWRST,
                                        ^^^^^
> > +					S3C_GPIO_BASE + S3C2440_GSTATUS2);
> > +		return 0;
> > +	}
> > +
> > +	if (reg & S3C2440_GSTATUS2_SLEEPRST) {
> > +		set_reset_source(RESET_WKE);
> > +		writel(S3C2440_GSTATUS2_SLEEPRST,
                                        ^^^^^^^^
> > +					S3C_GPIO_BASE + S3C2440_GSTATUS2);
> > +		return 0;
> > +	}
> > +
> > +	if (reg & S3C2440_GSTATUS2_WDRST) {
> > +		set_reset_source(RESET_WDG);
> > +		writel(S3C2440_GSTATUS2_WDRST,
                                        ^^^^^
> > +					S3C_GPIO_BASE + S3C2440_GSTATUS2);
> > +		return 0;
> > +	}
>
> That "writel(S3C2440_GSTATUS2_WDRST...)" is the same in each line, isn't
> it?

Take a closer look. ;)

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux