EXPORT_SYMBOL and rebinding functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey guys,

I have a module which defines a specific print function, and another
module that uses said function. From the first module I have used
EXPORT_SYMBOL(function_1). From within the second module I would like to
rebind that function to another printing function, and once I'm
finished, rebind it back to the original function.

So in theory the pseudo-code would look something like this

module_1.c

function_1()
{
	do some stuff
}

my_print_function = function_1

EXPORT_SYMBOL(my_print_function)

module_2.c



function_t()
{
	doing different stuff
}

placeholder = my_print_function
my_print_fuction = function_2

<do some other stuff>

my_print_function = placeholder

<END OF CODE>

My question is: Is this the correct way of doing this? Or will this
cause issues?


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux