访问结构指针的结构指针成员

时间:2016-10-27 05:55:35

标签: c linux driver

大家好,

    struct pwm_bl_data {
        struct pwm_device       *pwm;
        struct device           *dev;
        unsigned int            period;
        unsigned int            lth_brightness;
        int                     (*notify)(struct device *,
                                  int brightness);
        int                     (*check_fb)(struct device *, struct fb_info*);
    };

    static int pwm_backlight_update_status(struct backlight_device *bl)
    {
        struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);
        int brightness = bl->props.brightness;
        int max = bl->props.max_brightness;
        int ret;
        if (bl->props.power != FB_BLANK_UNBLANK)
            brightness = 0;

        if (bl->props.fb_blank != FB_BLANK_UNBLANK)
            brightness = 0;

        if (pb->notify)
            brightness = pb->notify(pb->dev, brightness);

        printk("THE PWM ID COMING in UPDATE STATUS IS %d\n", *(pb->pwm->pwm_id));
        . . .

我正在尝试访问pwm_idunsigned int成员struct pwm但我正在

error: dereferencing pointer to incomplete type

0 个答案:

没有答案