[PATCH v3 1/3] power: reset: add linkstation-reset driver
Andrew Lunn
andrew at lunn.ch
Tue Jan 3 05:09:16 PST 2017
> > +
> > + /* Check that nothing else has already setup a handler */
> > + if (pm_power_off) {
> > + lookup_symbol_name((ulong)pm_power_off, symname);
> > + dev_err(&pdev->dev,
> > + "pm_power_off already claimed %p %s",
> > + pm_power_off, symname);
> > + return -EBUSY;
> > + }
> > + pm_power_off = linkstation_reset;
>
> That seems a bit complicated, why not just assume that there will be
> either this driver used, or not at all?
That is probably my fault. This is a copy from code i wrote many years
ago for the QNAP. I guess at the time i was battling with two
different pm_power_off handlers, so put in this code.
> Also, you are supposed to register a reboot notifier to which you can
> pass private context:
At the time i wrote the QNAP code, this did not exist. So maybe my
code is no longer a good example to copy.
Andrew
More information about the linux-arm-kernel
mailing list