Find the answer to your Linux question:
Results 1 to 2 of 2
Hello: Couple questions, would appreciate any help: #1: In the construct below, what is the result of the single "#" that precedes _name below: #define DEFINE_DEV(_name, _id) \ static u64 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    6

    struct platform_device question


    Hello:

    Couple questions, would appreciate any help:

    #1: In the construct below, what is the result of the single "#" that precedes _name below:

    #define DEFINE_DEV(_name, _id) \
    static u64 _name##_id##_dma_mask = DMA_32BIT_MASK; \
    static struct platform_device _name##_id##_device = { \
    .name = #_name, \
    .id = _id, \
    .dev = { \
    .dma_mask = &_name##_id##_dma_mask, \
    .coherent_dma_mask = DMA_32BIT_MASK, \
    }, \
    .resource = _name##_id##_resource, \
    .num_resources = ARRAY_SIZE(_name##_id##_resource), \
    }


    #2: Is the string value pointed to by the .name field in struct platform_device, the string value that should be used in the .name field of struct platform_driver when calling the platform_driver_probe() function?

    Thanks!

  2. #2
    Just Joined!
    Join Date
    Mar 2011
    Posts
    1
    Yes, the string value pointed to by .name in platform_device structure and in platform_driver structure should be same....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •