X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=target%2Flinux%2Far71xx%2Fpatches-4.4%2F613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch;h=5c1205d59f917bdb8141733b9d7f8fed682b0185;hb=f80963d4d18d67c3190d40b7eadaa0e427ccbf7b;hp=a832bf84ceb0249e60745aadca6b7c837ff267b3;hpb=2530640f07cd2b3b14fe9ec03fa63a586452cc5f;p=librecmc%2Flibrecmc.git diff --git a/target/linux/ar71xx/patches-4.4/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch b/target/linux/ar71xx/patches-4.4/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch index a832bf84ce..5c1205d59f 100644 --- a/target/linux/ar71xx/patches-4.4/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch +++ b/target/linux/ar71xx/patches-4.4/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch @@ -12,18 +12,18 @@ #include "dev-wmac.h" static u8 ath79_wmac_mac[ETH_ALEN]; -@@ -313,6 +315,51 @@ void __init ath79_wmac_set_tx_gain_buffa +@@ -324,6 +326,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) {