From patchwork Fri Feb 21 21:03:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11397509 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A2831580 for ; Fri, 21 Feb 2020 21:05:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 775BE2073A for ; Fri, 21 Feb 2020 21:05:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="FKqLbwYp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 775BE2073A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F0C06F568; Fri, 21 Feb 2020 21:05:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D3296F54E for ; Fri, 21 Feb 2020 21:04:26 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id m10so6028107wmc.0 for ; Fri, 21 Feb 2020 13:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GyxR3rEO1FZs5BIiNni8jF96PqjDo3eJFecq4xcaCuE=; b=FKqLbwYpCJh/G4beB3K01XZBRr88JdbyVsip7AJAXSusET0Yo7DyFeADuxBZ7pD+a6 yqJFK+29ItSI31Jbt4X10v9Ak67WXCe6x58B1jb3qH4CwwVx5g9zmJNGTcf62zpXvPxl +ID1eRgtQlE0/mfsyou1E+B+AWtgeLSM23qQY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GyxR3rEO1FZs5BIiNni8jF96PqjDo3eJFecq4xcaCuE=; b=KzPUBSc3LMj8koM44Lol/7yV0W2GghhH9UxCiROLyv4WbuTd2Xhd6C/pSxO8Ztdrpj ua6PRce0u5GQsgf+JIFLn8z/IKky+J6hd0puKXbiBt+nkITtJ9+HeX3A70YRojurhGQt QgJC1nwGChy5EMOO7CYl4Q5SgomdvjGpJxTTCAvAMhT8aILthD/gE7S9i1opaAPu0fqh 6qQWUplFOCTd7W60Zjog2X5JN1KwWh5FM0A5hGgLjQgCdk+vS1XpOLL4fSpJh1u/Pjp9 mAMDB/h4a/Yp0Ar+IlgXx0E7NjmsTHm0DL7evgZnoqXDh13NSgFTfRpp5KhNgSk6VfrF zJTQ== X-Gm-Message-State: APjAAAVJGw4Im7ar1qh11ErY4Kn5DGcuMy3WbwlCPEaDNXGhQLyw1rsN 2A899IC4QBais+dMSOwN2PwJRvFMWI8= X-Google-Smtp-Source: APXvYqyIfandGDu5SDngcE91603NqzpDGsO2mWHGOc2I4/cSMYSqcTpzU6J4h7XgOzGxJx2ncmt4Lg== X-Received: by 2002:a1c:c5:: with SMTP id 188mr5498490wma.187.1582319064492; Fri, 21 Feb 2020 13:04:24 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id z6sm5483930wrw.36.2020.02.21.13.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 13:04:23 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 43/51] drm/gm12u320: Use devm_drm_dev_init Date: Fri, 21 Feb 2020 22:03:11 +0100 Message-Id: <20200221210319.2245170-44-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200221210319.2245170-1-daniel.vetter@ffwll.ch> References: <20200221210319.2245170-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Hans de Goede , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Only drops the drm_dev_put, but hey a few lines! Signed-off-by: Daniel Vetter Cc: Hans de Goede Cc: "Noralf Trønnes" Reviewed-by: Hans de Goede --- drivers/gpu/drm/tiny/gm12u320.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c index 5bd26fc6fafa..65dfb87ccb13 100644 --- a/drivers/gpu/drm/tiny/gm12u320.c +++ b/drivers/gpu/drm/tiny/gm12u320.c @@ -678,7 +678,7 @@ static int gm12u320_usb_probe(struct usb_interface *interface, init_waitqueue_head(&gm12u320->fb_update.waitq); dev = &gm12u320->dev; - ret = drm_dev_init(dev, &gm12u320_drm_driver, &interface->dev); + ret = devm_drm_dev_init(&interface->dev, dev, &gm12u320_drm_driver); if (ret) { kfree(gm12u320); return ret; @@ -688,7 +688,7 @@ static int gm12u320_usb_probe(struct usb_interface *interface, ret = drm_mode_config_init(dev); if (ret) - goto err_put; + return ret; dev->mode_config.min_width = GM12U320_USER_WIDTH; dev->mode_config.max_width = GM12U320_USER_WIDTH; @@ -698,15 +698,15 @@ static int gm12u320_usb_probe(struct usb_interface *interface, ret = gm12u320_usb_alloc(gm12u320); if (ret) - goto err_put; + return ret; ret = gm12u320_set_ecomode(gm12u320); if (ret) - goto err_put; + return ret; ret = gm12u320_conn_init(gm12u320); if (ret) - goto err_put; + return ret; ret = drm_simple_display_pipe_init(&gm12u320->dev, &gm12u320->pipe, @@ -716,22 +716,18 @@ static int gm12u320_usb_probe(struct usb_interface *interface, gm12u320_pipe_modifiers, &gm12u320->conn); if (ret) - goto err_put; + return ret; drm_mode_config_reset(dev); usb_set_intfdata(interface, dev); ret = drm_dev_register(dev, 0); if (ret) - goto err_put; + return ret; drm_fbdev_generic_setup(dev, 0); return 0; - -err_put: - drm_dev_put(dev); - return ret; } static void gm12u320_usb_disconnect(struct usb_interface *interface) @@ -741,7 +737,6 @@ static void gm12u320_usb_disconnect(struct usb_interface *interface) gm12u320_stop_fb_update(gm12u320); drm_dev_unplug(dev); - drm_dev_put(dev); } static __maybe_unused int gm12u320_suspend(struct usb_interface *interface,