...probably what your release function should do is free the devicewhich should be dynamically allocated here, platform_device_alloc() willdo the right thing for you. This isn't usually an issue for staticplatform devices as they are registered from board files which can't beunloaded.