@@ -370,6 +370,7 @@ int amba_driver_register(struct amba_driver *drv)
370370
371371 return driver_register (& drv -> drv );
372372}
373+ EXPORT_SYMBOL (amba_driver_register );
373374
374375/**
375376 * amba_driver_unregister - remove an AMBA device driver
@@ -383,7 +384,7 @@ void amba_driver_unregister(struct amba_driver *drv)
383384{
384385 driver_unregister (& drv -> drv );
385386}
386-
387+ EXPORT_SYMBOL ( amba_driver_unregister );
387388
388389static void amba_device_release (struct device * dev )
389390{
@@ -642,6 +643,7 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
642643
643644 return amba_device_add (dev , parent );
644645}
646+ EXPORT_SYMBOL (amba_device_register );
645647
646648/**
647649 * amba_device_put - put an AMBA device
@@ -668,66 +670,7 @@ void amba_device_unregister(struct amba_device *dev)
668670{
669671 device_unregister (& dev -> dev );
670672}
671-
672-
673- struct find_data {
674- struct amba_device * dev ;
675- struct device * parent ;
676- const char * busid ;
677- unsigned int id ;
678- unsigned int mask ;
679- };
680-
681- static int amba_find_match (struct device * dev , void * data )
682- {
683- struct find_data * d = data ;
684- struct amba_device * pcdev = to_amba_device (dev );
685- int r ;
686-
687- r = (pcdev -> periphid & d -> mask ) == d -> id ;
688- if (d -> parent )
689- r &= d -> parent == dev -> parent ;
690- if (d -> busid )
691- r &= strcmp (dev_name (dev ), d -> busid ) == 0 ;
692-
693- if (r ) {
694- get_device (dev );
695- d -> dev = pcdev ;
696- }
697-
698- return r ;
699- }
700-
701- /**
702- * amba_find_device - locate an AMBA device given a bus id
703- * @busid: bus id for device (or NULL)
704- * @parent: parent device (or NULL)
705- * @id: peripheral ID (or 0)
706- * @mask: peripheral ID mask (or 0)
707- *
708- * Return the AMBA device corresponding to the supplied parameters.
709- * If no device matches, returns NULL.
710- *
711- * NOTE: When a valid device is found, its refcount is
712- * incremented, and must be decremented before the returned
713- * reference.
714- */
715- struct amba_device *
716- amba_find_device (const char * busid , struct device * parent , unsigned int id ,
717- unsigned int mask )
718- {
719- struct find_data data ;
720-
721- data .dev = NULL ;
722- data .parent = parent ;
723- data .busid = busid ;
724- data .id = id ;
725- data .mask = mask ;
726-
727- bus_for_each_dev (& amba_bustype , NULL , & data , amba_find_match );
728-
729- return data .dev ;
730- }
673+ EXPORT_SYMBOL (amba_device_unregister );
731674
732675/**
733676 * amba_request_regions - request all mem regions associated with device
@@ -749,6 +692,7 @@ int amba_request_regions(struct amba_device *dev, const char *name)
749692
750693 return ret ;
751694}
695+ EXPORT_SYMBOL (amba_request_regions );
752696
753697/**
754698 * amba_release_regions - release mem regions associated with device
@@ -763,11 +707,4 @@ void amba_release_regions(struct amba_device *dev)
763707 size = resource_size (& dev -> res );
764708 release_mem_region (dev -> res .start , size );
765709}
766-
767- EXPORT_SYMBOL (amba_driver_register );
768- EXPORT_SYMBOL (amba_driver_unregister );
769- EXPORT_SYMBOL (amba_device_register );
770- EXPORT_SYMBOL (amba_device_unregister );
771- EXPORT_SYMBOL (amba_find_device );
772- EXPORT_SYMBOL (amba_request_regions );
773710EXPORT_SYMBOL (amba_release_regions );
0 commit comments