Skip to content

Commit 35a395f

Browse files
Laurent Pinchartsravnborg
authored andcommitted
drm: bridge: dw-hdmi: Constify mode argument to dw_hdmi_phy_ops .init()
The PHY .init() must not modify the mode it receives. Make the pointer const to enfore that. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-17-laurent.pinchart+renesas@ideasonboard.com
1 parent af05bba commit 35a395f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ static int hdmi_phy_configure(struct dw_hdmi *hdmi)
15311531
}
15321532

15331533
static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
1534-
struct drm_display_mode *mode)
1534+
const struct drm_display_mode *mode)
15351535
{
15361536
int i, ret;
15371537

drivers/gpu/drm/meson/meson_dw_hdmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static inline void dw_hdmi_dwc_write_bits(struct meson_dw_hdmi *dw_hdmi,
297297

298298
/* Setup PHY bandwidth modes */
299299
static void meson_hdmi_phy_setup_mode(struct meson_dw_hdmi *dw_hdmi,
300-
struct drm_display_mode *mode)
300+
const struct drm_display_mode *mode)
301301
{
302302
struct meson_drm *priv = dw_hdmi->priv;
303303
unsigned int pixel_clock = mode->clock;
@@ -427,7 +427,7 @@ static void dw_hdmi_set_vclk(struct meson_dw_hdmi *dw_hdmi,
427427
}
428428

429429
static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
430-
struct drm_display_mode *mode)
430+
const struct drm_display_mode *mode)
431431
{
432432
struct meson_dw_hdmi *dw_hdmi = (struct meson_dw_hdmi *)data;
433433
struct meson_drm *priv = dw_hdmi->priv;

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static const struct drm_encoder_helper_funcs dw_hdmi_rockchip_encoder_helper_fun
312312
};
313313

314314
static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, void *data,
315-
struct drm_display_mode *mode)
315+
const struct drm_display_mode *mode)
316316
{
317317
struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
318318

drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static int sun8i_hdmi_phy_config_h3(struct dw_hdmi *hdmi,
341341
}
342342

343343
static int sun8i_hdmi_phy_config(struct dw_hdmi *hdmi, void *data,
344-
struct drm_display_mode *mode)
344+
const struct drm_display_mode *mode)
345345
{
346346
struct sun8i_hdmi_phy *phy = (struct sun8i_hdmi_phy *)data;
347347
u32 val = 0;

include/drm/bridge/dw_hdmi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct dw_hdmi_phy_config {
114114

115115
struct dw_hdmi_phy_ops {
116116
int (*init)(struct dw_hdmi *hdmi, void *data,
117-
struct drm_display_mode *mode);
117+
const struct drm_display_mode *mode);
118118
void (*disable)(struct dw_hdmi *hdmi, void *data);
119119
enum drm_connector_status (*read_hpd)(struct dw_hdmi *hdmi, void *data);
120120
void (*update_hpd)(struct dw_hdmi *hdmi, void *data,

0 commit comments

Comments
 (0)