Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2218030pxu; Mon, 7 Dec 2020 00:06:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8IxwSrDb7R0QWizqpmS9JUB0VZUQBq9KVYRKROqZPZG/muofXyidBBo8wh3ZIyVZaBNND X-Received: by 2002:a50:bb44:: with SMTP id y62mr4083719ede.103.1607328391536; Mon, 07 Dec 2020 00:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607328391; cv=none; d=google.com; s=arc-20160816; b=fuhEVK/gnYWEx+uSWhO9ly6a06McfjxQqNcdKLsvc0N9QebVRhbopOXE0lIb2Yp3hV pfCxrEnwcxMAo7eDNZOaMipLIgQtV+C8g8vAJN90r848o5M9F1pAEmKDG6/VF11wZSR2 Z3Z7b2FLWS/Dxg05e2c+SDFlLgavY30vKV2/TnNI1lXyp6XovHAepAOthvz566qtQuwO DrN7q6akzhCbXFTbu2uzRRYYnVe3RFtmtsomDpeLkZ7mah1tCuJYJbjQVg+iwMCWwlDv g6oFAWF4RhEa6G1GOZ+ZF0VCZmApSvLaZ9X1wlteVvIf983HIl80ynsYAS1BPRTJNkbf vObw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=ay47Knf3wLoEXJbIcW0QZgyOMNKOs2py7cvVnhvJnF0=; b=a1xyeobMMT2Yf0J7RegcyIZepOa8rwkL2g1a7FZa/eu2cscuDWORhUtSrPpndybB+y xoEV1ZpP0hOiJERKBIRlj/eNdrxUfTRwSzsXUGKu2C5eNuw5unvc9SxniIyz6j1hbOUt jfTjtu6oagfRoTM4oCx7FcRg67KxyB/jVs8zCVc8GbOiRg5bVC6aODYx9z1o9nPfGlND dUXeMnFyYGD3W+m25jJWr+uVePx4xYfrz5s7DRb1qW7llJYNJYxxcL+lL6UfEDsABOvm 8e+fNGCOFlFGb2nrcpqDhmkYWL8HrD4Ff7OlG0xlEI8lLxGGRZAt9PEkUoJ5VXvTvPpI SqAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si7707800edy.18.2020.12.07.00.06.09; Mon, 07 Dec 2020 00:06:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726264AbgLGIE2 (ORCPT + 99 others); Mon, 7 Dec 2020 03:04:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:56256 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbgLGIE2 (ORCPT ); Mon, 7 Dec 2020 03:04:28 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AD0C0AC9A; Mon, 7 Dec 2020 08:03:46 +0000 (UTC) Subject: Re: [PATCH drm/hisilicon 1/2] drm/hisilicon: Use managed mode-config init To: Tian Tao , airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org References: <1607302172-60123-1-git-send-email-tiantao6@hisilicon.com> <1607302172-60123-2-git-send-email-tiantao6@hisilicon.com> From: Thomas Zimmermann Message-ID: Date: Mon, 7 Dec 2020 09:03:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <1607302172-60123-2-git-send-email-tiantao6@hisilicon.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="80odkjGCcbfPDE9qIJkqNNKY3rNHialNG" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --80odkjGCcbfPDE9qIJkqNNKY3rNHialNG Content-Type: multipart/mixed; boundary="rSeKpMEG8NxEtli9NgiqrkACXqpsKmn3V"; protected-headers="v1" From: Thomas Zimmermann To: Tian Tao , airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org Message-ID: Subject: Re: [PATCH drm/hisilicon 1/2] drm/hisilicon: Use managed mode-config init References: <1607302172-60123-1-git-send-email-tiantao6@hisilicon.com> <1607302172-60123-2-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1607302172-60123-2-git-send-email-tiantao6@hisilicon.com> --rSeKpMEG8NxEtli9NgiqrkACXqpsKmn3V Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 07.12.20 um 01:49 schrieb Tian Tao: > Using drmm_mode_config_init() sets up managed release of modesetting > resources. > Signed-off-by: Tian Tao > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 13 +++---------- > 1 file changed, 3 insertions(+), 10 deletions(-) >=20 > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/= gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > index 3687753..d631f82 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > @@ -96,7 +96,9 @@ static int hibmc_kms_init(struct hibmc_drm_private *p= riv) > struct drm_device *dev =3D &priv->dev; > int ret; > =20 > - drm_mode_config_init(dev); > + ret =3D drmm_mode_config_init(dev); > + if (ret) > + return ret; > priv->mode_config_initialized =3D true; I think mode_config_initialized is only required by hibmc_kms_finit(),=20 which you remove. You should remove this line and the field from struct=20 hibmc_drm_private. Best regards Thomas > =20 > dev->mode_config.min_width =3D 0; > @@ -125,14 +127,6 @@ static int hibmc_kms_init(struct hibmc_drm_private= *priv) > return 0; > } > =20 > -static void hibmc_kms_fini(struct hibmc_drm_private *priv) > -{ > - if (priv->mode_config_initialized) { > - drm_mode_config_cleanup(&priv->dev); > - priv->mode_config_initialized =3D false; > - } > -} > - > /* > * It can operate in one of three modes: 0, 1 or Sleep. > */ > @@ -262,7 +256,6 @@ static int hibmc_unload(struct drm_device *dev) > drm_atomic_helper_shutdown(dev); > =20 > pci_disable_msi(dev->pdev); > - hibmc_kms_fini(priv); > dev->dev_private =3D NULL; > return 0; > } >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --rSeKpMEG8NxEtli9NgiqrkACXqpsKmn3V-- --80odkjGCcbfPDE9qIJkqNNKY3rNHialNG Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAl/N4eEFAwAAAAAACgkQlh/E3EQov+Ai 0Q//eqJuBrVY30X+MZYNToSYM6gaSCN3C4Oz0YvhkPTMWkmbsHJK5GNiFAV2jCr9+cIuLey7nhmG Of/+KCKZWYQsSKuVVaPaIiEXPtFLB71tNRQgBq5NXgZczBBw5tEE0cWTosli2QcWyXgkGOgM3HsO Jh8idx33Z1sl8yKL5pBNZyik0t/1CBGcMqP9+pdRFKFVaUAxXViPj4hSeqCLce22svDxIUhGlfr5 nB9839dYMdOP0XNSnIruHFPuTBdCdxbwqk83lEVWaWZKJqTpLSHV7it7qNxQIYSgBpZgu6OFx/im eMc7aF2OTkP8e1ze+fKz/dDZp3ag4Dy4rbgrLlLSGQnh8nhwJjJdCPyfbkGF4tizEqaPelIMUfag cfsWGjOFxnWxlNwn3SX+anxwvRf/XmaCdrSu0tpDxoRtP5rofnlJwBlZ7vf4xt3iHjn7y4BY72MA yfKrtJG5THxGdqOJ6C34C+vSH6XJBqAPvWa1JKzOzg7hCARvHoqs45bZGtJLvpkE1YP89lsbUH/9 4P8IjzIRj/RAJTzCEfeNI7dtdKtHaD8/95b7V5RVkoWLOJG9eV/o4VAZxRvX8R2SYw4rz6pol3C1 15ibP4Tj6KPzBdz+uUwpC0raGOzsRpSrcEsb+pKhFNRDxZb/jeSW6hcShPTBFKjHk7nbP2JsZP9w ZmI= =SSDP -----END PGP SIGNATURE----- --80odkjGCcbfPDE9qIJkqNNKY3rNHialNG--