Hi, Baruch Thanks for the comments !
Baruch Siach wrote: > Hi Stanimir, > > On Thu, Aug 25, 2011 at 04:29:12PM +0300, Stanimir Varbanov wrote: >> On some devices the flash chip could be powered off when m25p driver >> is probed. To avoid erroneous detection the power of the chip must be >> turn on, add a power function in m25p_probe to switch on the power by >> platform data. The power will be turned off at the probe end. > > [snip] > >> + /* power on device while probing */ >> + m25p_power(data, 1); > > [snip] > >> +out: >> + m25p_power(data, 0); > > Shouldn't you power off in m25p_remove() as well? > IMO, no, because m25p_power(off) is called from m25p_put_device(). Then m25p_put_device() is called from mtdchar::mtd_close(). m25p_remove must fail if user didn't close mtdchar /dev/mtdX device. The motivation to use power on/off in m25p_probe is because the flash chip might be not powered when driver probe is called. The chip is powered on on the probe begging and powered off after JEDEC probe pass. > baruch > regards, Stan ------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev _______________________________________________ spi-devel-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spi-devel-general
