ar71xx: add AR724x PCIe init fixes
[openwrt/staging/chunkeey.git] / target / linux / ar71xx / patches-4.4 / 613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch
index a832bf84ceb0249e60745aadca6b7c837ff267b3..3d422bbbc76f1e9399154cf0ffd73068d301e19c 100644 (file)
  #include "dev-wmac.h"
  
  static u8 ath79_wmac_mac[ETH_ALEN];
-@@ -313,6 +315,51 @@ void __init ath79_wmac_set_tx_gain_buffa
+@@ -325,6 +327,51 @@ void __init ath79_wmac_set_tx_gain_buffa
        ath79_wmac_data.tx_gain_buffalo = true;
  }
  
 +static int ath79_request_ext_lna_gpio(unsigned chain, int gpio)
 +{
-+      char buf[32];
 +      char *label;
 +      int err;
 +
-+      scnprintf(buf, sizeof(buf), "external LNA%u", chain);
-+      label = kstrdup(buf, GFP_KERNEL);
++      label = kasprintf(GFP_KERNEL, "external LNA%u", chain);
++      if (!label)
++              return -ENOMEM;
 +
 +      err = gpio_request_one(gpio, GPIOF_DIR_OUT | GPIOF_INIT_LOW, label);
 +      if (err) {