Skip to content

gpio.h #342

Closed
Closed

Description

@cleverca22

i was trying to compile code that worked on the 3.10 branch and i had moved it to the 3.6 branch, and i noticed an unexpected error

error: initializer element is not constant

when looking at the code, i found out, that there are 2 completely different implementations of gpio_to_irq, 3.10 uses #define which the compiler happily accepts
3.6 uses an inline function, which the compiler thinks isn't constant, causing the above error

any reason against putting the 3.10 version of gpio_to_irq in the 3.6 branch?

arch/arm/mach-bcm2708/include/mach/gpio.h

Activity

  1. popcornmix commented on Jul 26, 2013

    @popcornmix
    Collaborator

    No, that won't happen. Your code can do:
    #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
    if you want to support both versions.

  2. cleverca22 commented on Jul 26, 2013

    @cleverca22
    Author

    is there any special reason why 3.6 and 3.10 have to do it differently?

  3. popcornmix commented on Jul 26, 2013

    @popcornmix
    Collaborator

    That's a decision for the upstream linux kernel, not for us.
    I can't modify the 3.6 kernel to use the 3.10 API, as that could break lots of existing code developed on 3.6.

  4. cleverca22 commented on Jul 26, 2013

    @cleverca22
    Author

    ah, ok, i'll just #if it out like you said

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions