@@ -561,22 +561,6 @@ static struct gpiod_lookup_table *ams_delta_gpio_tables[] __initdata = {
561561 & ams_delta_nand_gpio_table ,
562562};
563563
564- /*
565- * Some drivers may not use GPIO lookup tables but need to be provided
566- * with GPIO numbers. The same applies to GPIO based IRQ lines - some
567- * drivers may even not use GPIO layer but expect just IRQ numbers.
568- * We could either define GPIO lookup tables then use them on behalf
569- * of those devices, or we can use GPIO driver level methods for
570- * identification of GPIO and IRQ numbers. For the purpose of the latter,
571- * defina a helper function which identifies GPIO chips by their labels.
572- */
573- static int gpiochip_match_by_label (struct gpio_chip * chip , void * data )
574- {
575- char * label = data ;
576-
577- return !strcmp (label , chip -> label );
578- }
579-
580564static struct gpiod_hog ams_delta_gpio_hogs [] = {
581565 GPIO_HOG (LATCH2_LABEL , LATCH2_PIN_KEYBRD_DATAOUT , "keybrd_dataout" ,
582566 GPIO_ACTIVE_HIGH , GPIOD_OUT_LOW ),
@@ -616,14 +600,28 @@ static void __init modem_assign_irq(struct gpio_chip *chip)
616600 */
617601static void __init omap_gpio_deps_init (void )
618602{
603+ struct gpio_device * gdev ;
619604 struct gpio_chip * chip ;
620605
621- chip = gpiochip_find (OMAP_GPIO_LABEL , gpiochip_match_by_label );
622- if (!chip ) {
623- pr_err ("%s: OMAP GPIO chip not found\n" , __func__ );
606+ /*
607+ * Some drivers may not use GPIO lookup tables but need to be provided
608+ * with GPIO numbers. The same applies to GPIO based IRQ lines - some
609+ * drivers may even not use GPIO layer but expect just IRQ numbers.
610+ * We could either define GPIO lookup tables then use them on behalf
611+ * of those devices, or we can use GPIO driver level methods for
612+ * identification of GPIO and IRQ numbers.
613+ *
614+ * This reference will be leaked but that's alright as this device
615+ * never goes down.
616+ */
617+ gdev = gpio_device_find_by_label (OMAP_GPIO_LABEL );
618+ if (!gdev ) {
619+ pr_err ("%s: OMAP GPIO device not found\n" , __func__ );
624620 return ;
625621 }
626622
623+ chip = gpio_device_get_chip (gdev );
624+
627625 /*
628626 * Start with FIQ initialization as it may have to request
629627 * and release successfully each OMAP GPIO pin in turn.
0 commit comments