Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
propósito de __devexit_p en los archivos del controlador

¿Alguien puede decirme el propósito de la parte __devexit_p en los archivos del controlador?

Encuentro que __devexit_p normalmente se usa con funciones de eliminación en el código del controlador

Ejemplo 1 :

 static struct i2c_driver lsm9ds0_driver = { .driver = { .owner = THIS_MODULE, .name = LSM9DS0_DEV_NAME, }, .probe = lsm9ds0_probe, .remove = __devexit_p(lsm9ds0_remove), .id_table = lsm9ds0_id, };

Ejemplo 2:

 static struct spi_driver light_driver = { .driver = { .name = "light", .owner = THIS_MODULE, }, .probe = light_probe, .remove = __devexit_p(light_remove), };

¿Hay alguna diferencia si __devexit_p de los ejemplos anteriores? ¿Afectará el rendimiento del controlador cuando se elimine __devexit_p ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Basado en esta lista de LXR de 2.6.32 :

 /* Functions marked as __devexit may be discarded at kernel link time, depending on config options. Newer versions of binutils detect references from retained sections to discarded sections and flag an error. Pointers to __devexit functions must use __devexit_p(function_name), the wrapper will insert either the function_name or NULL, depending on the config options. */ #if defined(MODULE) || defined(CONFIG_HOTPLUG) #define __devexit_p(x) x #else #define __devexit_p(x) NULL #endif

parece usarse para expandirlo condicionalmente al parámetro dado o NULL según el código que se compila como parte de un módulo del núcleo ( MODULE ) y en la opción del núcleo CONFIG_HOTPLUG .

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!