On Fri, Aug 23, 2024 at 01:47:23PM -0700, Stephen Boyd wrote: > Quoting Tzung-Bi Shih (2024-08-22 07:35:13) > > On Mon, Aug 19, 2024 at 03:38:29PM -0700, Stephen Boyd wrote: > > > +struct cros_typec_dp_bridge { > > > + struct cros_typec_data *typec_data; > > > + struct drm_dp_typec_bridge_dev *dev; > > > +}; > > > > It looks like structs are all defined in cros_ec_typec.h. I think this struct > > definition can be also moved there. > > I put it here because it wasn't used by any other driver. Maybe I can > skip the entire struct though and add what I need directly to 'struct > cros_typec_data'. I see. * struct cros_typec_altmode_node, used by cros_ec_typec.c. * struct cros_typec_data, used by cros_ec_typec.c and cros_typec_vdm.c. * struct cros_typec_port, used by cros_ec_typec.c and cros_typec_vdm.c. cros_typec_switch.c has another struct cros_typec_port. To simplify, I'm not sure whether we should merge cros_ec_typec.h, cros_typec_vdm.c, and cros_typec_vdm.h into cros_ec_typec.c. Back to struct cros_typec_dp_bridge, I think it's fine to keep it as is. > > > > > > diff --git a/drivers/platform/chrome/cros_ec_typec.h b/drivers/platform/chrome/cros_ec_typec.h > > > index deda180a646f..73d300427140 100644 > > > --- a/drivers/platform/chrome/cros_ec_typec.h > > > +++ b/drivers/platform/chrome/cros_ec_typec.h > > > @@ -27,6 +27,8 @@ struct cros_typec_altmode_node { > > > struct list_head list; > > > }; > > > > > > +struct cros_typec_dp_bridge; > > > > If the struct definition moves here, it doesn't need to declare forward. > > But then we have to forward declare 'struct cros_typec_data'? There's no > escape. I see.