drm/panel: drop drm_device from drm_panel
authorSam Ravnborg <sam@ravnborg.org>
Sat, 7 Dec 2019 14:03:35 +0000 (15:03 +0100)
committerSam Ravnborg <sam@ravnborg.org>
Mon, 9 Dec 2019 21:57:26 +0000 (22:57 +0100)
The panel drivers used drm_panel.drm for two purposes:
1) Argument to drm_mode_duplicate()
2) drm->dev was used in error messages

The first usage is replaced with drm_connector.dev
- drm_connector is already connected to a drm_device
  and we have a valid connector

The second usage is replaced with drm_panel.dev
- this makes drivers more consistent in their dev argument
  used for dev_err() and friends

With these replacements there are no more uses of drm_panel.drm,
so it is removed from struct drm_panel.
With this change drm_panel_attach() and drm_panel_detach()
no longer have any use as they are empty functions.

v2:
  - editorial correction in changelog (Laurent)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Stefan Mavrodiev <stefan@olimex.com>
Cc: Robert Chiras <robert.chiras@nxp.com>
Cc: "Guido Günther" <agx@sigxcpu.org>
Cc: Purism Kernel Team <kernel@puri.sm>
Link: https://patchwork.freedesktop.org/patch/msgid/20191207140353.23967-8-sam@ravnborg.org
38 files changed:
drivers/gpu/drm/drm_panel.c
drivers/gpu/drm/panel/panel-arm-versatile.c
drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
drivers/gpu/drm/panel/panel-ilitek-ili9322.c
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
drivers/gpu/drm/panel/panel-innolux-p079zca.c
drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
drivers/gpu/drm/panel/panel-lg-lb035q02.c
drivers/gpu/drm/panel/panel-lg-lg4573.c
drivers/gpu/drm/panel/panel-lvds.c
drivers/gpu/drm/panel/panel-nec-nl8048hl11.c
drivers/gpu/drm/panel/panel-novatek-nt39016.c
drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c
drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
drivers/gpu/drm/panel/panel-raydium-rm67191.c
drivers/gpu/drm/panel/panel-raydium-rm68200.c
drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
drivers/gpu/drm/panel/panel-ronbo-rb070d30.c
drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
drivers/gpu/drm/panel/panel-sharp-ls037v7dw01.c
drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
drivers/gpu/drm/panel/panel-simple.c
drivers/gpu/drm/panel/panel-sitronix-st7701.c
drivers/gpu/drm/panel/panel-sitronix-st7789v.c
drivers/gpu/drm/panel/panel-sony-acx565akm.c
drivers/gpu/drm/panel/panel-tpo-td028ttec1.c
drivers/gpu/drm/panel/panel-tpo-td043mtea1.c
drivers/gpu/drm/panel/panel-tpo-tpg110.c
include/drm/drm_panel.h

index f6a745949da86c108424c8cf69514b4d85d8febd..03395ad4d9074da2126d21805fc4af0341732438 100644 (file)
@@ -114,11 +114,6 @@ EXPORT_SYMBOL(drm_panel_remove);
  */
 int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector)
 {
-       if (panel->drm)
-               return -EBUSY;
-
-       panel->drm = connector->dev;
-
        return 0;
 }
 EXPORT_SYMBOL(drm_panel_attach);
@@ -135,7 +130,6 @@ EXPORT_SYMBOL(drm_panel_attach);
  */
 void drm_panel_detach(struct drm_panel *panel)
 {
-       panel->drm = NULL;
 }
 EXPORT_SYMBOL(drm_panel_detach);
 
index 41aa91f60979d30ec56f62cffa504f0ca3e22523..41444a73c9807828c5d6f43f8bea67c43a0711fb 100644 (file)
@@ -270,7 +270,7 @@ static int versatile_panel_get_modes(struct drm_panel *panel,
        connector->display_info.height_mm = vpanel->panel_type->height_mm;
        connector->display_info.bus_flags = vpanel->panel_type->bus_flags;
 
-       mode = drm_mode_duplicate(panel->drm, &vpanel->panel_type->mode);
+       mode = drm_mode_duplicate(connector->dev, &vpanel->panel_type->mode);
        drm_mode_set_name(mode);
        mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
 
index 37d6b7390954dd4ba01ccb681eec524ca9363bb6..0157d1844e3efb1607d590dedb5ac1de48b058e2 100644 (file)
@@ -168,7 +168,7 @@ static int feiyang_get_modes(struct drm_panel *panel,
        struct feiyang *ctx = panel_to_feiyang(panel);
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &feiyang_default_mode);
+       mode = drm_mode_duplicate(connector->dev, &feiyang_default_mode);
        if (!mode) {
                DRM_DEV_ERROR(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n",
                              feiyang_default_mode.hdisplay,
index 7e5062b07ac8a068e6df2f3e230eabe8cedd02da..f394d53a7da4f6145e4cd6faf720eb1cc5287d83 100644 (file)
@@ -645,6 +645,7 @@ static int ili9322_get_modes(struct drm_panel *panel,
                             struct drm_connector *connector)
 {
        struct ili9322 *ili = panel_to_ili9322(panel);
+       struct drm_device *drm = connector->dev;
        struct drm_display_mode *mode;
        struct drm_display_info *info;
 
@@ -663,26 +664,26 @@ static int ili9322_get_modes(struct drm_panel *panel,
 
        switch (ili->input) {
        case ILI9322_INPUT_SRGB_DUMMY_320X240:
-               mode = drm_mode_duplicate(panel->drm, &srgb_320x240_mode);
+               mode = drm_mode_duplicate(drm, &srgb_320x240_mode);
                break;
        case ILI9322_INPUT_SRGB_DUMMY_360X240:
-               mode = drm_mode_duplicate(panel->drm, &srgb_360x240_mode);
+               mode = drm_mode_duplicate(drm, &srgb_360x240_mode);
                break;
        case ILI9322_INPUT_PRGB_THROUGH:
        case ILI9322_INPUT_PRGB_ALIGNED:
-               mode = drm_mode_duplicate(panel->drm, &prgb_320x240_mode);
+               mode = drm_mode_duplicate(drm, &prgb_320x240_mode);
                break;
        case ILI9322_INPUT_YUV_640X320_YCBCR:
-               mode = drm_mode_duplicate(panel->drm, &yuv_640x320_mode);
+               mode = drm_mode_duplicate(drm, &yuv_640x320_mode);
                break;
        case ILI9322_INPUT_YUV_720X360_YCBCR:
-               mode = drm_mode_duplicate(panel->drm, &yuv_720x360_mode);
+               mode = drm_mode_duplicate(drm, &yuv_720x360_mode);
                break;
        case ILI9322_INPUT_ITU_R_BT656_720X360_YCBCR:
-               mode = drm_mode_duplicate(panel->drm, &itu_r_bt_656_720_mode);
+               mode = drm_mode_duplicate(drm, &itu_r_bt_656_720_mode);
                break;
        case ILI9322_INPUT_ITU_R_BT656_640X320_YCBCR:
-               mode = drm_mode_duplicate(panel->drm, &itu_r_bt_656_640_mode);
+               mode = drm_mode_duplicate(drm, &itu_r_bt_656_640_mode);
                break;
        default:
                mode = NULL;
index 1c67a668d6bf0c3352f84d61991c6521ea1662bf..31e5a4e67750b39725439eae3bec755b060a768d 100644 (file)
@@ -393,7 +393,7 @@ static int ili9881c_get_modes(struct drm_panel *panel,
        struct ili9881c *ctx = panel_to_ili9881c(panel);
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &bananapi_default_mode);
+       mode = drm_mode_duplicate(connector->dev, &bananapi_default_mode);
        if (!mode) {
                dev_err(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n",
                        bananapi_default_mode.hdisplay,
index facf1bab2532b144c5eba5b5594ba715a2b67825..b9de37a8a0c5e356f0332f52e7b2a9aba59a84eb 100644 (file)
@@ -211,7 +211,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
 
        ret = backlight_enable(innolux->backlight);
        if (ret) {
-               DRM_DEV_ERROR(panel->drm->dev,
+               DRM_DEV_ERROR(panel->dev,
                              "Failed to enable backlight %d\n", ret);
                return ret;
        }
@@ -410,9 +410,9 @@ static int innolux_panel_get_modes(struct drm_panel *panel,
        const struct drm_display_mode *m = innolux->desc->mode;
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, m);
+       mode = drm_mode_duplicate(connector->dev, m);
        if (!mode) {
-               DRM_DEV_ERROR(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
+               DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n",
                              m->hdisplay, m->vdisplay, m->vrefresh);
                return -ENOMEM;
        }
index e6b650a64fdb39262504a2b38e68a4e0e7f69e4f..4bfd8c877c8ebb75af3af784fdc51a478186530c 100644 (file)
@@ -307,7 +307,7 @@ static int jdi_panel_get_modes(struct drm_panel *panel,
        struct jdi_panel *jdi = to_jdi_panel(panel);
        struct device *dev = &jdi->dsi->dev;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
                dev_err(dev, "failed to add mode %ux%ux@%u\n",
                        default_mode.hdisplay, default_mode.vdisplay,
index e6f53d56daf9226760e6eddc50ce66d2a38231d0..353ee6caa01c6e889c678b031eb3a4cc00da270a 100644 (file)
@@ -310,7 +310,7 @@ static int kingdisplay_panel_enable(struct drm_panel *panel)
 
        ret = backlight_enable(kingdisplay->backlight);
        if (ret) {
-               DRM_DEV_ERROR(panel->drm->dev,
+               DRM_DEV_ERROR(panel->dev,
                              "Failed to enable backlight %d\n", ret);
                return ret;
        }
@@ -338,9 +338,9 @@ static int kingdisplay_panel_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
-               DRM_DEV_ERROR(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
+               DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n",
                              default_mode.hdisplay, default_mode.vdisplay,
                              default_mode.vrefresh);
                return -ENOMEM;
index 7a3bd4d80c79ae2b16fa78f70cdbeb117ba47241..e90efeaba4ad5282857c485568e0cbf4dca9f239 100644 (file)
@@ -146,7 +146,7 @@ static int lb035q02_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &lb035q02_mode);
+       mode = drm_mode_duplicate(connector->dev, &lb035q02_mode);
        if (!mode)
                return -ENOMEM;
 
index fc6572b4e2f9c5373eff46eb2f7590acc82f7b70..20235ff0bbc4b7ea7f2e521ab8738c8b5bdd32f8 100644 (file)
@@ -214,9 +214,9 @@ static int lg4573_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
-               dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
+               dev_err(panel->dev, "failed to add mode %ux%ux@%u\n",
                        default_mode.hdisplay, default_mode.vdisplay,
                        default_mode.vrefresh);
                return -ENOMEM;
index f6d58a60e5146b000c407e549881ae2872a6344b..5e40b674bb1528223633059e89a1720c8ad240f9 100644 (file)
@@ -112,7 +112,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
        struct panel_lvds *lvds = to_panel_lvds(panel);
        struct drm_display_mode *mode;
 
-       mode = drm_mode_create(lvds->panel.drm);
+       mode = drm_mode_create(connector->dev);
        if (!mode)
                return 0;
 
index a6ccdb09aace838657065e5d13ab7488b92c92bf..c4f83f6384e1a930bd64e81a89967c57dca2165a 100644 (file)
@@ -128,7 +128,7 @@ static int nl8048_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &nl8048_mode);
+       mode = drm_mode_duplicate(connector->dev, &nl8048_mode);
        if (!mode)
                return -ENOMEM;
 
index 91ea49c05611020d779e4a7d1f985c12080912a5..a470810f7dbef8ecd54595227e4c821a0397b758 100644 (file)
@@ -213,7 +213,7 @@ static int nt39016_get_modes(struct drm_panel *drm_panel,
        const struct nt39016_panel_info *panel_info = panel->panel_info;
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(drm_panel->drm, &panel_info->display_mode);
+       mode = drm_mode_duplicate(connector->dev, &panel_info->display_mode);
        if (!mode)
                return -ENOMEM;
 
index 2b7e0dfebc5ef80d8e3bcfe6add60ac71918058f..e553e584399b671c4e089d82f5e643ac3208070b 100644 (file)
@@ -146,7 +146,6 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel,
 {
        struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel);
        struct lcd_olinuxino_info *lcd_info = &lcd->eeprom.info;
-       struct drm_device *drm = lcd->panel.drm;
        struct lcd_olinuxino_mode *lcd_mode;
        struct drm_display_mode *mode;
        u32 i, num = 0;
@@ -155,9 +154,9 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel,
                lcd_mode = (struct lcd_olinuxino_mode *)
                           &lcd->eeprom.reserved[i * sizeof(*lcd_mode)];
 
-               mode = drm_mode_create(drm);
+               mode = drm_mode_create(connector->dev);
                if (!mode) {
-                       dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
+                       dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
                                lcd_mode->hactive,
                                lcd_mode->vactive,
                                lcd_mode->refresh);
index 4e1606c7907226d65d4b26e4d5a71b0b1420e57c..bb0c992171e83f412ebe3f82a1c86ccf9130e0d7 100644 (file)
@@ -354,7 +354,7 @@ static int otm8009a_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
                DRM_ERROR("failed to add mode %ux%ux@%u\n",
                          default_mode.hdisplay, default_mode.vdisplay,
index b3e010288c10a88e2e3d13ef2d6fa6d04dcbe974..2734b4835dfa14d99d112239f37346938f4926ba 100644 (file)
@@ -118,9 +118,9 @@ static int osd101t2587_panel_get_modes(struct drm_panel *panel,
        struct osd101t2587_panel *osd101t2587 = ti_osd_panel(panel);
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, osd101t2587->default_mode);
+       mode = drm_mode_duplicate(connector->dev, osd101t2587->default_mode);
        if (!mode) {
-               dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
+               dev_err(panel->dev, "failed to add mode %ux%ux@%u\n",
                        osd101t2587->default_mode->hdisplay,
                        osd101t2587->default_mode->vdisplay,
                        osd101t2587->default_mode->vrefresh);
index 19a6eb4637c8d0ab5f415a4c7f3bf337529f3d14..489a96f04fd88d0dd28bb29a6481b619326dc266 100644 (file)
@@ -171,11 +171,11 @@ static int wuxga_nt_panel_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
-               dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
-                               default_mode.hdisplay, default_mode.vdisplay,
-                               default_mode.vrefresh);
+               dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
+                       default_mode.hdisplay, default_mode.vdisplay,
+                       default_mode.vrefresh);
                return -ENOMEM;
        }
 
index 0b8cc199c8d25a7ea52ad941e0a901644bf87584..8f078b7dd89e79b95476317016d7146357e94a3d 100644 (file)
@@ -312,7 +312,6 @@ static int rpi_touchscreen_enable(struct drm_panel *panel)
 static int rpi_touchscreen_get_modes(struct drm_panel *panel,
                                     struct drm_connector *connector)
 {
-       struct drm_device *drm = panel->drm;
        unsigned int i, num = 0;
        static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
 
@@ -320,9 +319,9 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel,
                const struct drm_display_mode *m = &rpi_touchscreen_modes[i];
                struct drm_display_mode *mode;
 
-               mode = drm_mode_duplicate(drm, m);
+               mode = drm_mode_duplicate(connector->dev, m);
                if (!mode) {
-                       dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
+                       dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
                                m->hdisplay, m->vdisplay, m->vrefresh);
                        continue;
                }
index 123bb68cfcb7ca9aab24d4a4cbc5b5f6ae1c8fa3..313637d53d28770cc90f2dedec10677730daf92d 100644 (file)
@@ -441,7 +441,7 @@ static int rad_panel_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
                DRM_DEV_ERROR(panel->dev, "failed to add mode %ux%ux@%u\n",
                              default_mode.hdisplay, default_mode.vdisplay,
index 66fa975308ecb03067fdef2bf084061087dbc558..d6a03328e5949adafcb41d8ad066795e0c137f49 100644 (file)
@@ -340,7 +340,7 @@ static int rm68200_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
                DRM_ERROR("failed to add mode %ux%ux@%u\n",
                          default_mode.hdisplay, default_mode.vdisplay,
index b2d61cab3cad05950b11a5ba55794afd8ab6b3a3..3a4f1c0fce86170e47923f8451cc647d2681ee95 100644 (file)
@@ -236,7 +236,7 @@ static int jh057n_get_modes(struct drm_panel *panel,
        struct jh057n *ctx = panel_to_jh057n(panel);
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
                DRM_DEV_ERROR(ctx->dev, "Failed to add mode %ux%u@%u\n",
                              default_mode.hdisplay, default_mode.vdisplay,
index 57a462ce221e73651f3593140ea96937c72d9473..746a3a2211006358bb00f396800894042f17e127 100644 (file)
@@ -127,7 +127,7 @@ static int rb070d30_panel_get_modes(struct drm_panel *panel,
        struct drm_display_mode *mode;
        static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
                DRM_DEV_ERROR(&ctx->dsi->dev,
                              "Failed to add mode " DRM_MODE_FMT "\n",
index 71939ab757b1236ad20f62adadf64ef5fa3a9ca2..2150043dcf6b31b096a0fad181e11c7937173289 100644 (file)
@@ -148,7 +148,7 @@ static int s6d16d0_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &samsung_s6d16d0_mode);
+       mode = drm_mode_duplicate(connector->dev, &samsung_s6d16d0_mode);
        if (!mode) {
                DRM_ERROR("bad mode or failed to add mode\n");
                return -EINVAL;
index 8e0236ba6145b05055755d5a6bb30802ba288f80..36ebd5a4ac7bd159b44c2f220e46d1c7dbd02a5f 100644 (file)
@@ -651,7 +651,7 @@ static int s6e3ha2_get_modes(struct drm_panel *panel,
        struct s6e3ha2 *ctx = container_of(panel, struct s6e3ha2, panel);
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, ctx->desc->mode);
+       mode = drm_mode_duplicate(connector->dev, ctx->desc->mode);
        if (!mode) {
                DRM_ERROR("failed to add mode %ux%ux@%u\n",
                        ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay,
index c939d5bde4f09c1e8ef26f77fb232d6853f1fdb0..a3570e0a90a8f293bb168bc7515ccd1ae14ccd65 100644 (file)
@@ -405,7 +405,7 @@ static int s6e63j0x03_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
                DRM_ERROR("failed to add mode %ux%ux@%u\n",
                        default_mode.hdisplay, default_mode.vdisplay,
index 1d099092e75447a9d536c2a67f4065df445b48f9..a5f76eb4fa25b205ad40c6289da7588c62d105e8 100644 (file)
@@ -367,7 +367,7 @@ static int s6e63m0_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
                DRM_ERROR("failed to add mode %ux%ux@%u\n",
                          default_mode.hdisplay, default_mode.vdisplay,
index b878930b17e40c77bf48dfce82370df0c3d2b2f5..18e745104aaffd90fbe3c09e0a2eae81c76ffc73 100644 (file)
@@ -59,7 +59,6 @@ static inline struct seiko_panel *to_seiko_panel(struct drm_panel *panel)
 static int seiko_panel_get_fixed_modes(struct seiko_panel *panel,
                                       struct drm_connector *connector)
 {
-       struct drm_device *drm = panel->base.drm;
        struct drm_display_mode *mode;
        unsigned int i, num = 0;
 
@@ -71,9 +70,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel,
                struct videomode vm;
 
                videomode_from_timing(dt, &vm);
-               mode = drm_mode_create(drm);
+               mode = drm_mode_create(connector->dev);
                if (!mode) {
-                       dev_err(drm->dev, "failed to add mode %ux%u\n",
+                       dev_err(panel->base.dev, "failed to add mode %ux%u\n",
                                dt->hactive.typ, dt->vactive.typ);
                        continue;
                }
@@ -92,9 +91,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel,
        for (i = 0; i < panel->desc->num_modes; i++) {
                const struct drm_display_mode *m = &panel->desc->modes[i];
 
-               mode = drm_mode_duplicate(drm, m);
+               mode = drm_mode_duplicate(connector->dev, m);
                if (!mode) {
-                       dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
+                       dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
                                m->hdisplay, m->vdisplay, m->vrefresh);
                        continue;
                }
index e797b700661ab6b27610d3fe1d4f8646270e88d7..17d406f49c3d6a070d9cdec312149c1a7c122c04 100644 (file)
@@ -283,9 +283,9 @@ static int sharp_panel_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
-               dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
+               dev_err(panel->dev, "failed to add mode %ux%ux@%u\n",
                        default_mode.hdisplay, default_mode.vdisplay,
                        default_mode.vrefresh);
                return -ENOMEM;
index 7103a945f0e8127ece50bf4616db2a5b5ab6be18..1cf3f02435c1c563dcf794bf501a315782c41454 100644 (file)
@@ -105,7 +105,7 @@ static int ls037v7dw01_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &ls037v7dw01_mode);
+       mode = drm_mode_duplicate(connector->dev, &ls037v7dw01_mode);
        if (!mode)
                return -ENOMEM;
 
index 85ae6cffdbfbbb4c4ac8fb8ffe51592491f6d6c7..97f82ec93c834b9204e76ea50521add20ba8a8ef 100644 (file)
@@ -215,11 +215,11 @@ static int sharp_nt_panel_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
-               dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
-                               default_mode.hdisplay, default_mode.vdisplay,
-                               default_mode.vrefresh);
+               dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
+                       default_mode.hdisplay, default_mode.vdisplay,
+                       default_mode.vrefresh);
                return -ENOMEM;
        }
 
index 1309ca7454b95588869fb5cca1dd26cc161844d1..ba3f85f36c2f9874c9ed8415d23fb9e4b82520e6 100644 (file)
@@ -120,7 +120,6 @@ static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
 static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
                                                   struct drm_connector *connector)
 {
-       struct drm_device *drm = panel->base.drm;
        struct drm_display_mode *mode;
        unsigned int i, num = 0;
 
@@ -129,9 +128,9 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
                struct videomode vm;
 
                videomode_from_timing(dt, &vm);
-               mode = drm_mode_create(drm);
+               mode = drm_mode_create(connector->dev);
                if (!mode) {
-                       dev_err(drm->dev, "failed to add mode %ux%u\n",
+                       dev_err(panel->base.dev, "failed to add mode %ux%u\n",
                                dt->hactive.typ, dt->vactive.typ);
                        continue;
                }
@@ -153,16 +152,15 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
 static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
                                                   struct drm_connector *connector)
 {
-       struct drm_device *drm = panel->base.drm;
        struct drm_display_mode *mode;
        unsigned int i, num = 0;
 
        for (i = 0; i < panel->desc->num_modes; i++) {
                const struct drm_display_mode *m = &panel->desc->modes[i];
 
-               mode = drm_mode_duplicate(drm, m);
+               mode = drm_mode_duplicate(connector->dev, m);
                if (!mode) {
-                       dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
+                       dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
                                m->hdisplay, m->vdisplay, m->vrefresh);
                        continue;
                }
@@ -184,7 +182,6 @@ static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
 static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
                                           struct drm_connector *connector)
 {
-       struct drm_device *drm = panel->base.drm;
        struct drm_display_mode *mode;
        bool has_override = panel->override_mode.type;
        unsigned int num = 0;
@@ -193,12 +190,13 @@ static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
                return 0;
 
        if (has_override) {
-               mode = drm_mode_duplicate(drm, &panel->override_mode);
+               mode = drm_mode_duplicate(connector->dev,
+                                         &panel->override_mode);
                if (mode) {
                        drm_mode_probed_add(connector, mode);
                        num = 1;
                } else {
-                       dev_err(drm->dev, "failed to add override mode\n");
+                       dev_err(panel->base.dev, "failed to add override mode\n");
                }
        }
 
index 3ed3b1d6d82d11a6f37684abfbc24ebb1b077647..c08a865a2a933cf969560a2d520955b650ceac94 100644 (file)
@@ -271,7 +271,7 @@ static int st7701_get_modes(struct drm_panel *panel,
        const struct drm_display_mode *desc_mode = st7701->desc->mode;
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, desc_mode);
+       mode = drm_mode_duplicate(connector->dev, desc_mode);
        if (!mode) {
                DRM_DEV_ERROR(&st7701->dsi->dev,
                              "failed to add mode %ux%ux@%u\n",
index 836b0133150579c85e5d9b77b32e599632ff5cee..ebefe2f4c26b6e43aa7a88ac2767338936767f6a 100644 (file)
@@ -175,9 +175,9 @@ static int st7789v_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &default_mode);
+       mode = drm_mode_duplicate(connector->dev, &default_mode);
        if (!mode) {
-               dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
+               dev_err(panel->dev, "failed to add mode %ux%ux@%u\n",
                        default_mode.hdisplay, default_mode.vdisplay,
                        default_mode.vrefresh);
                return -ENOMEM;
index 841dc73c443d9fa9d92f2d5853183fc2504adc94..5c4b6f6e5c2d74f61711a9b2887796d539d365c5 100644 (file)
@@ -526,7 +526,7 @@ static int acx565akm_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &acx565akm_mode);
+       mode = drm_mode_duplicate(connector->dev, &acx565akm_mode);
        if (!mode)
                return -ENOMEM;
 
index 5230176bd8e6c2729cfa1e0245f31aa1437cfcff..37252590b54152cc0f0f5ce0985a2d8ab8877888 100644 (file)
@@ -292,7 +292,7 @@ static int td028ttec1_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &td028ttec1_mode);
+       mode = drm_mode_duplicate(connector->dev, &td028ttec1_mode);
        if (!mode)
                return -ENOMEM;
 
index 716f8ed1cc45e0f387bbd1ffdc674910bc0c757e..75f1f1f1b6de7914ca8e2ee374a064ef5ddf85e5 100644 (file)
@@ -351,7 +351,7 @@ static int td043mtea1_get_modes(struct drm_panel *panel,
 {
        struct drm_display_mode *mode;
 
-       mode = drm_mode_duplicate(panel->drm, &td043mtea1_mode);
+       mode = drm_mode_duplicate(connector->dev, &td043mtea1_mode);
        if (!mode)
                return -ENOMEM;
 
index e74cd9d418cf305f05e3efc37e1e82b6afd2cecd..bee213ea1a42f22b601ebe6c7ac494646a1b8c3c 100644 (file)
@@ -394,7 +394,7 @@ static int tpg110_get_modes(struct drm_panel *panel,
        connector->display_info.height_mm = tpg->height;
        connector->display_info.bus_flags = tpg->panel_mode->bus_flags;
 
-       mode = drm_mode_duplicate(panel->drm, &tpg->panel_mode->mode);
+       mode = drm_mode_duplicate(connector->dev, &tpg->panel_mode->mode);
        drm_mode_set_name(mode);
        mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
 
index 03a5860f1a1bc5ed7ebe1f24b3233e5be4b8d316..5f27b693e1a0c92b455b8da6316dfd700acc5948 100644 (file)
@@ -129,13 +129,6 @@ struct drm_panel_funcs {
  * struct drm_panel - DRM panel object
  */
 struct drm_panel {
-       /**
-        * @drm:
-        *
-        * DRM device owning the panel.
-        */
-       struct drm_device *drm;
-
        /**
         * @dev:
         *