The geo/channel information is obtained from the EEPROM, which is read
during probe. We can thus set up channel information at this time. This
helps us to support ioctl commands that rely on this before the interface
is brought up.
Clearly matches _init_channel_map with _free_channel_map and _init_geos
with _free_geos to ensure functions calling these routines can also call
their cleanup routines.
Fixes a few bugs:
- if channel information is not available when ioctl commands are
issued then we get a NULL pointer oops. Having channel information
set up during probe we can deal with ioctl commands without requiring
interface to be brought up.
This fixes bug: http://www.bughost.org/bugzilla/show_bug.cgi?id=1552
- Fix potential problem if user triggers probe/remove/probe sequence. The
value of priv->channel_count was used to determine if channel map is
set up. This value was never reset when channel map was removed.
- Fix memory leak: priv->modes need to be freed when device removed.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>