aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/spider_net.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/spider_net.c')
-rw-r--r--drivers/net/spider_net.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 2154469678b7..94e238f6ed31 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1895,16 +1895,27 @@ spider_net_download_firmware(struct spider_net_card *card,
1895static int 1895static int
1896spider_net_init_firmware(struct spider_net_card *card) 1896spider_net_init_firmware(struct spider_net_card *card)
1897{ 1897{
1898 const struct firmware *firmware; 1898 struct firmware *firmware;
1899 struct device_node *dn;
1900 u8 *fw_prop;
1899 int err = -EIO; 1901 int err = -EIO;
1900 1902
1901 if (request_firmware(&firmware, 1903 if (request_firmware((const struct firmware **)&firmware,
1902 SPIDER_NET_FIRMWARE_NAME, &card->pdev->dev) < 0) { 1904 SPIDER_NET_FIRMWARE_NAME, &card->pdev->dev) < 0) {
1903 if (netif_msg_probe(card)) 1905 if (netif_msg_probe(card))
1904 pr_err("Couldn't read in sequencer data file %s.\n", 1906 pr_err("Couldn't read in sequencer data file %s.\n",
1905 SPIDER_NET_FIRMWARE_NAME); 1907 SPIDER_NET_FIRMWARE_NAME);
1906 firmware = NULL; 1908
1907 goto out; 1909 dn = pci_device_to_OF_node(card->pdev);
1910 if (!dn)
1911 goto out;
1912
1913 fw_prop = (u8 *)get_property(dn, "firmware", NULL);
1914 if (!fw_prop)
1915 goto out;
1916
1917 memcpy(firmware->data, fw_prop, 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32));
1918 firmware->size = 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32);
1908 } 1919 }
1909 1920
1910 if (firmware->size != 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32)) { 1921 if (firmware->size != 6 * SPIDER_NET_FIRMWARE_LEN * sizeof(u32)) {