简体   繁体   中英

How do I assign value when structure has a void *pointer

I am trying to assign a value to variable which has a void *pointer . Below is the assignment as best as I understand. (Doesn't work)

void set_fb_video ()
{

goldfish_lcd.dev.(atmel_lcdfb_info*)platform_data->default_monspecs->modedb->xres = 10;
};

Below are part of structures as defined in header files

Header files

struct fb_videomode {
      ..
      u32 xres;
      ..
};

struct fb_monspecs {
      ..
      struct fb_videomode *modedb;
      ..
};

struct atmel_lcdfb_info;

struct atmel_lcdfb_info {
      ..
      struct fb_monspecs *default_monspecs;
      ..
};

struct device {
     ..
     void *platform_data;
     ..
};

struct platform_device {
      ..
      struct device dev;
      ..
};

C files

struct fb_videomode at91_tft_vga_modes[] = {
      ..
      .xres = 100,
      ..
};


struct fb_monspecs &at91fb_default_monspecs = {
      ..
      .modedb = at91_tft_vga_modes,
      ..
};

struct atmel_lcdfb_info ek_lcdc_data = {
      ..
      .default_monspecs = &at91fb_default_monspecs,
      ..
};

struct platform_device goldfish_lcd ={
      ..
      .dev = {
           ..
           .platform_data = &ek_lcdc_data,
          },
      ..
};

Any suggestions are greatly appreciated.

Thank you in advance

您的演员atmel_lcdfb_info不在正确的位置,并且您没有名为atmel_lcdfb_info的类型:

((struct atmel_lcdfb_info*)goldfish_lcd.dev.platform_data)->default_monspecs->modedb->xres = 10;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM