Search Linux Wireless

Re: [PATCH] libertas: return errno from lbs_add_card()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lubomir,

I love your patch! Yet something to improve:

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on v4.19-rc7 next-20181008]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Lubomir-Rintel/libertas-return-errno-from-lbs_add_card/20180925-105034
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: i386-randconfig-a0-10081439 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/net/wireless/marvell/libertas/if_spi.c: In function 'if_spi_probe':
>> drivers/net/wireless/marvell/libertas/if_spi.c:1150:3: error: 'ret' undeclared (first use in this function)
      ret = PTR_ERR(priv);
      ^
   drivers/net/wireless/marvell/libertas/if_spi.c:1150:3: note: each undeclared identifier is reported only once for each function it appears in

vim +/ret +1150 drivers/net/wireless/marvell/libertas/if_spi.c

  1103	
  1104	static int if_spi_probe(struct spi_device *spi)
  1105	{
  1106		struct if_spi_card *card;
  1107		struct lbs_private *priv = NULL;
  1108		struct libertas_spi_platform_data *pdata = dev_get_platdata(&spi->dev);
  1109		int err = 0;
  1110	
  1111		if (!pdata) {
  1112			err = -EINVAL;
  1113			goto out;
  1114		}
  1115	
  1116		if (pdata->setup) {
  1117			err = pdata->setup(spi);
  1118			if (err)
  1119				goto out;
  1120		}
  1121	
  1122		/* Allocate card structure to represent this specific device */
  1123		card = kzalloc(sizeof(struct if_spi_card), GFP_KERNEL);
  1124		if (!card) {
  1125			err = -ENOMEM;
  1126			goto teardown;
  1127		}
  1128		spi_set_drvdata(spi, card);
  1129		card->pdata = pdata;
  1130		card->spi = spi;
  1131		card->prev_xfer_time = jiffies;
  1132	
  1133		INIT_LIST_HEAD(&card->cmd_packet_list);
  1134		INIT_LIST_HEAD(&card->data_packet_list);
  1135		spin_lock_init(&card->buffer_lock);
  1136	
  1137		/* Initialize the SPI Interface Unit */
  1138	
  1139		/* Firmware load */
  1140		err = if_spi_init_card(card);
  1141		if (err)
  1142			goto free_card;
  1143	
  1144		/*
  1145		 * Register our card with libertas.
  1146		 * This will call alloc_etherdev.
  1147		 */
  1148		priv = lbs_add_card(card, &spi->dev);
  1149		if (IS_ERR(priv)) {
> 1150			ret = PTR_ERR(priv);
  1151			goto free_card;
  1152		}
  1153		card->priv = priv;
  1154		priv->setup_fw_on_resume = 1;
  1155		priv->card = card;
  1156		priv->hw_host_to_card = if_spi_host_to_card;
  1157		priv->enter_deep_sleep = NULL;
  1158		priv->exit_deep_sleep = NULL;
  1159		priv->reset_deep_sleep_wakeup = NULL;
  1160		priv->fw_ready = 1;
  1161	
  1162		/* Initialize interrupt handling stuff. */
  1163		card->workqueue = alloc_workqueue("libertas_spi", WQ_MEM_RECLAIM, 0);
  1164		if (!card->workqueue) {
  1165			err = -ENOMEM;
  1166			goto remove_card;
  1167		}
  1168		INIT_WORK(&card->packet_work, if_spi_host_to_card_worker);
  1169		INIT_WORK(&card->resume_work, if_spi_resume_worker);
  1170	
  1171		err = request_irq(spi->irq, if_spi_host_interrupt,
  1172				IRQF_TRIGGER_FALLING, "libertas_spi", card);
  1173		if (err) {
  1174			pr_err("can't get host irq line-- request_irq failed\n");
  1175			goto terminate_workqueue;
  1176		}
  1177	
  1178		/*
  1179		 * Start the card.
  1180		 * This will call register_netdev, and we'll start
  1181		 * getting interrupts...
  1182		 */
  1183		err = lbs_start_card(priv);
  1184		if (err)
  1185			goto release_irq;
  1186	
  1187		lbs_deb_spi("Finished initializing WLAN module.\n");
  1188	
  1189		/* successful exit */
  1190		goto out;
  1191	
  1192	release_irq:
  1193		free_irq(spi->irq, card);
  1194	terminate_workqueue:
  1195		destroy_workqueue(card->workqueue);
  1196	remove_card:
  1197		lbs_remove_card(priv); /* will call free_netdev */
  1198	free_card:
  1199		free_if_spi_card(card);
  1200	teardown:
  1201		if (pdata->teardown)
  1202			pdata->teardown(spi);
  1203	out:
  1204		return err;
  1205	}
  1206	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux