if (val & (SD_CD | MS_CD))
if (val & (SD_CD | MS_CD)) {
device_for_each_child(&intf->dev, NULL, rtsx_usb_resume_child);
Why not calling rtsx_usb_resume() here?
Because in this time rtsx_usb is not in runtime_suspend, only need to make sure child is not in suspend Actually when the program came here this suspend will be rejected because return -EAGAIN
return -EAGAIN;
}
I meant:
if (val & (SD_CD | MS_CD)) { rtsx_usb_resume(intf) return -EAGAIN; }
It looks cleaner, as it indicates the the supsend is rejected and needs to be undone. The code is in the end indentical to the patch you are proposing. This is just for look anyway, the patch as-is is acceptable.