Modifying file_operations
Warning! This might be a stupid question.
Is it safe to modify the read() entry of a driver's file_operations struct in order to modify the behaviour of the driver depending upon some context, say a particular hardware mode. Or is the only way to do this safely to test the current mode in read() adding overhead to the function.
Ta,
Simon