[gpio:gpio-descriptors-usb 6/6] drivers/usb/phy/phy-gpio-vbus-usb.c:275:22: error: 'vbus_gpio' undeclared

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-usb
head:   ec84cd4d1bb85874b0ed3f5e4e567fb2ccb956bd
commit: ec84cd4d1bb85874b0ed3f5e4e567fb2ccb956bd [6/6] usb: phy: phy-gpio-vbus-usb: Convert to GPIO descriptors
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout ec84cd4d1bb85874b0ed3f5e4e567fb2ccb956bd
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   drivers/usb/phy/phy-gpio-vbus-usb.c: In function 'gpio_vbus_probe':
>> drivers/usb/phy/phy-gpio-vbus-usb.c:275:22: error: 'vbus_gpio' undeclared (first use in this function)
      irq = gpiod_to_irq(vbus_gpio->vbus_gpiod);
                         ^~~~~~~~~
   drivers/usb/phy/phy-gpio-vbus-usb.c:275:22: note: each undeclared identifier is reported only once for each function it appears in
   drivers/usb/phy/phy-gpio-vbus-usb.c:237:11: warning: unused variable 'gpio' [-Wunused-variable]
     int err, gpio, irq;
              ^~~~
   drivers/usb/phy/phy-gpio-vbus-usb.c:235:20: warning: unused variable 'gpiod' [-Wunused-variable]
     struct gpio_desc *gpiod;
                       ^~~~~

vim +/vbus_gpio +275 drivers/usb/phy/phy-gpio-vbus-usb.c

   230	
   231	static int gpio_vbus_probe(struct platform_device *pdev)
   232	{
   233		struct gpio_vbus_data *gpio_vbus;
   234		struct resource *res;
   235		struct gpio_desc *gpiod;
   236		struct device *dev = &pdev->dev;
   237		int err, gpio, irq;
   238		unsigned long irqflags;
   239	
   240		gpio_vbus = devm_kzalloc(&pdev->dev, sizeof(struct gpio_vbus_data),
   241					 GFP_KERNEL);
   242		if (!gpio_vbus)
   243			return -ENOMEM;
   244	
   245		gpio_vbus->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
   246						  GFP_KERNEL);
   247		if (!gpio_vbus->phy.otg)
   248			return -ENOMEM;
   249	
   250		platform_set_drvdata(pdev, gpio_vbus);
   251		gpio_vbus->dev = &pdev->dev;
   252		gpio_vbus->phy.label = "gpio-vbus";
   253		gpio_vbus->phy.dev = gpio_vbus->dev;
   254		gpio_vbus->phy.set_power = gpio_vbus_set_power;
   255		gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend;
   256	
   257		gpio_vbus->phy.otg->state = OTG_STATE_UNDEFINED;
   258		gpio_vbus->phy.otg->usb_phy = &gpio_vbus->phy;
   259		gpio_vbus->phy.otg->set_peripheral = gpio_vbus_set_peripheral;
   260	
   261		/* Look up the VBUS sensing GPIO */
   262		gpio_vbus->vbus_gpiod = devm_gpiod_get(dev, "vbus", GPIOD_IN);
   263		if (IS_ERR(gpio_vbus->vbus_gpiod)) {
   264			err = PTR_ERR(gpio_vbus->vbus_gpiod);
   265			dev_err(&pdev->dev, "can't request vbus gpio, err: %d\n", err);
   266			return err;
   267		}
   268		gpiod_set_consumer_name(gpio_vbus->vbus_gpiod, "vbus_detect");
   269	
   270		res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
   271		if (res) {
   272			irq = res->start;
   273			irqflags = (res->flags & IRQF_TRIGGER_MASK) | IRQF_SHARED;
   274		} else {
 > 275			irq = gpiod_to_irq(vbus_gpio->vbus_gpiod);
   276			irqflags = VBUS_IRQ_FLAGS;
   277		}
   278	
   279		gpio_vbus->irq = irq;
   280	
   281		/*
   282		 * The VBUS sensing GPIO should have a pulldown, which will normally be
   283		 * part of a resistor ladder turning a 4.0V-5.25V level on VBUS into a
   284		 * value the GPIO detects as active. Some systems will use comparators.
   285		 * Get the optional D+ or D- pullup GPIO. If the data line pullup is
   286		 * in use, initialize it to "not pulling up"
   287		 */
   288		gpio_vbus->pullup_gpiod = devm_gpiod_get_optional(dev, "pullup",
   289								  GPIOD_OUT_LOW);
   290		if (IS_ERR(gpio_vbus->pullup_gpiod)) {
   291			err = PTR_ERR(gpio_vbus->vbus_gpiod);
   292			dev_err(&pdev->dev, "can't request pullup gpio, err: %d\n",
   293				err);
   294			return err;
   295		}
   296		if (gpio_vbus->pullup_gpiod)
   297			gpiod_set_consumer_name(gpio_vbus->vbus_gpiod, "udc_pullup");
   298	
   299		err = devm_request_irq(&pdev->dev, irq, gpio_vbus_irq, irqflags,
   300				       "vbus_detect", pdev);
   301		if (err) {
   302			dev_err(&pdev->dev, "can't request irq %i, err: %d\n",
   303				irq, err);
   304			return err;
   305		}
   306	
   307		INIT_DELAYED_WORK(&gpio_vbus->work, gpio_vbus_work);
   308	
   309		gpio_vbus->vbus_draw = devm_regulator_get(&pdev->dev, "vbus_draw");
   310		if (IS_ERR(gpio_vbus->vbus_draw)) {
   311			dev_dbg(&pdev->dev, "can't get vbus_draw regulator, err: %ld\n",
   312				PTR_ERR(gpio_vbus->vbus_draw));
   313			gpio_vbus->vbus_draw = NULL;
   314		}
   315	
   316		/* only active when a gadget is registered */
   317		err = usb_add_phy(&gpio_vbus->phy, USB_PHY_TYPE_USB2);
   318		if (err) {
   319			dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
   320				err);
   321			return err;
   322		}
   323	
   324		/* TODO: wakeup could be enabled here with device_init_wakeup(dev, 1) */
   325	
   326		return 0;
   327	}
   328	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux