[rt2x00-users] [PATCH 1/3] rt2800pci: remove rt2800pci_set_state function
kubakici at wp.pl
Sat Jan 21 03:43:35 AEDT 2012
On Fri, 20 Jan 2012 09:25:19 +0100
Stanislaw Gruszka <sgruszka at redhat.com> wrote:
> On Tue, Jan 17, 2012 at 05:22:52PM +0100, Jakub Kicinski wrote:
> > rt2800pci_disable_radio(rt2x00dev);
> > - rt2800pci_set_state(rt2x00dev, STATE_SLEEP);
> > + rt2800pci_set_device_state(rt2x00dev, STATE_SLEEP);
> I a bit dislike these recursive calls. I would prefer direct calls to
> rt2800pci_mcu_request() and eventually rearrange switch() statement do do
> fall through, i.e:
> case STATE_RADIO_OFF:
> * After the radio has been disabled, the device should
> * be put to sleep for powersaving.
> /* fall through */
> case STATE_DEEP_SLEEP:
> case STATE_SLEEP:
> case STATE_STANDBY:
> /* PCIe devices won't report status after SLEEP request. */
> rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
> rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
> rt2800_mcu_req(rt2x00dev, MCU_SLEEP, TOKEN_SLEEP, 0xff, 0x01);
Yes, I thought about that but decided that recursion is more "obvious"
to read. I can change that if you like.
I assume no one is opposed to this change in general. There is similar
function for usb devices should we drop it as well?
More information about the users