int cw1200_register_common(struct ieee80211_hw *dev) { struct cw1200_common *priv = dev->priv; int err; err = cw1200_pm_init(&priv->pm_state, priv); if (err) { cw1200_dbg(CW1200_DBG_ERROR, "Cannot init PM. (%d).\n", err); return err; } err = ieee80211_register_hw(dev); if (err) { cw1200_dbg(CW1200_DBG_ERROR, "Cannot register device (%d).\n", err); cw1200_pm_deinit(&priv->pm_state); return err; } #ifdef CONFIG_CW1200_LEDS err = cw1200_init_leds(priv); if (err) { cw1200_pm_deinit(&priv->pm_state); ieee80211_unregister_hw(dev); return err; } #endif /* CONFIG_CW1200_LEDS */ cw1200_debug_init(priv); cw1200_dbg(CW1200_DBG_MSG, "is registered as '%s'\n", wiphy_name(dev->wiphy)); return 0; }
static int cw1200_register_common(struct ieee80211_hw *dev) { struct cw1200_common *priv = dev->priv; int err; #ifdef CONFIG_PM err = cw1200_pm_init(&priv->pm_state, priv); if (err) { pr_err("Cannot init PM. (%d).\n", err); return err; } #endif err = ieee80211_register_hw(dev); if (err) { pr_err("Cannot register device (%d).\n", err); #ifdef CONFIG_PM cw1200_pm_deinit(&priv->pm_state); #endif return err; } cw1200_debug_init(priv); pr_info("Registered as '%s'\n", wiphy_name(dev->wiphy)); return 0; }