static int pega_rfkill_init(struct asus_laptop *asus) { int ret = 0; if(!asus->is_pega_lucid) return -ENODEV; ret = pega_rfkill_setup(asus, &asus->wlan, "pega-wlan", PEGA_WLAN, RFKILL_TYPE_WLAN); if(ret) goto exit; ret = pega_rfkill_setup(asus, &asus->bluetooth, "pega-bt", PEGA_BLUETOOTH, RFKILL_TYPE_BLUETOOTH); if(ret) goto exit; ret = pega_rfkill_setup(asus, &asus->wwan, "pega-wwan", PEGA_WWAN, RFKILL_TYPE_WWAN); exit: if (ret) asus_rfkill_exit(asus); return ret; }
static int pega_rfkill_init(struct asus_laptop *asus) { int ret = 0; if(!asus->is_pega_lucid) return -ENODEV; ret = pega_rfkill_setup(asus, &asus->wlanrfk, "pega-wlan", PEGA_WLAN, RFKILL_TYPE_WLAN); if(ret) return ret; ret = pega_rfkill_setup(asus, &asus->btrfk, "pega-bt", PEGA_BLUETOOTH, RFKILL_TYPE_BLUETOOTH); if(ret) goto err_btrfk; ret = pega_rfkill_setup(asus, &asus->wwanrfk, "pega-wwan", PEGA_WWAN, RFKILL_TYPE_WWAN); if(ret) goto err_wwanrfk; pr_warn("Pega rfkill init succeeded\n"); return 0; err_wwanrfk: pega_rfkill_terminate(&asus->btrfk); err_btrfk: pega_rfkill_terminate(&asus->wlanrfk); return ret; }