From patchwork Tue Jun 17 14:17:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_Mart=C3=ADnez?= X-Patchwork-Id: 4366291 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 56E849F3FF for ; Tue, 17 Jun 2014 14:16:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65F7920303 for ; Tue, 17 Jun 2014 14:16:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE158201BC for ; Tue, 17 Jun 2014 14:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932972AbaFQOQE (ORCPT ); Tue, 17 Jun 2014 10:16:04 -0400 Received: from mail-yk0-f170.google.com ([209.85.160.170]:48484 "EHLO mail-yk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932133AbaFQOQD (ORCPT ); Tue, 17 Jun 2014 10:16:03 -0400 Received: by mail-yk0-f170.google.com with SMTP id q9so5261207ykb.15 for ; Tue, 17 Jun 2014 07:16:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=VHx3k8AH3z4B/RHSaBbsanH+5to1rJdN19zLX1hh8MY=; b=cipzCn9Zn7PcjaWK8pWszBZyINnu114urLaH9JQTuuWnLCJLPlH7ZtzAUthJYZy4cv 0ZK5N05v/HGPdKRSUKGzIDEVLbxnwNu1/g6EQD5dAg0RoccYmadcKNHFJLtJXyUAkvZp Yf7ZMpewUQ0YKmCyoTOO8OT2qYR9HyYcbUD7L1Se0+JjhwLAciGWGw+7g+uPDW6xmnIy cVXopQjos/B3xvPxPvSMsSOQkWyyilX+at9YAHDDjWxEtQR8hWM3hETOVTB8XFlT3Pj9 70T93vP8STujx4/mZg+DdOEez5IUFg63IqU54U7aiGBeHHXsExqvujP/A/VVn2nkH9cl uujQ== X-Gm-Message-State: ALoCoQmsGDOs8H48xVafVYfW4RVdHUGHN9YGguLug31XH2m8Ed8GF4r0BP6Qu+yHxhIpHnPbim9/ X-Received: by 10.236.100.171 with SMTP id z31mr44259718yhf.70.1403014561675; Tue, 17 Jun 2014 07:16:01 -0700 (PDT) Received: from localhost (host18.190-30-94.telecom.net.ar. [190.30.94.18]) by mx.google.com with ESMTPSA id o42sm17770377yhe.51.2014.06.17.07.15.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jun 2014 07:16:00 -0700 (PDT) From: =?UTF-8?q?Guido=20Mart=C3=ADnez?= To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Cc: robdclark@gmail.com, =?UTF-8?q?Ezequiel=20Garc=C3=ADa?= , airlied@linux.ie, Daniel Mack , Russell King , Daniel Vetter , =?UTF-8?q?Guido=20Mart=C3=ADnez?= , Subject: [PATCH/RESEND 2/9] drm/tilcdc: panel: fix dangling sysfs connector node Date: Tue, 17 Jun 2014 11:17:04 -0300 Message-Id: <1403014631-18072-3-git-send-email-guido@vanguardiasur.com.ar> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403014631-18072-1-git-send-email-guido@vanguardiasur.com.ar> References: <1402110128-30471-1-git-send-email-guido@vanguardiasur.com.ar> <1403014631-18072-1-git-send-email-guido@vanguardiasur.com.ar> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a drm_sysfs_connector_remove call when we destroy the panel to make sure the connector node in sysfs gets deleted. This is required for proper unload and re-load of this driver as a module. Without this, we would get a warning at re-load time like so: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 824 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x54/0x74() sysfs: cannot create duplicate filename '/class/drm/card0-LVDS-1' Modules linked in: [...] CPU: 0 PID: 824 Comm: modprobe Not tainted 3.15.0-rc4-00027-g6484f96-dirty #81 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (warn_slowpath_common+0x68/0x88) [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x30/0x40) [] (warn_slowpath_fmt) from [] (sysfs_warn_dup+0x54/0x74) [] (sysfs_warn_dup) from [] (sysfs_do_create_link_sd.isra.2+0xb0/0xb8) [] (sysfs_do_create_link_sd.isra.2) from [] (device_add+0x338/0x520) [] (device_add) from [] (device_create_groups_vargs+0xa0/0xc4) [] (device_create_groups_vargs) from [] (device_create+0x24/0x2c) [] (device_create) from [] (drm_sysfs_connector_add+0x64/0x204) [] (drm_sysfs_connector_add) from [] (panel_modeset_init+0xb8/0x134 [tilcdc]) [] (panel_modeset_init [tilcdc]) from [] (tilcdc_load+0x214/0x4c0 [tilcdc]) [] (tilcdc_load [tilcdc]) from [] (drm_dev_register+0xa4/0x104) [ .. snip .. ] ---[ end trace b2d09cd9578b0497 ]--- [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: -17 Signed-off-by: Guido Martínez Cc: #v3.9+ --- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 86c6732..1943b2f 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -151,6 +151,7 @@ struct panel_connector { static void panel_connector_destroy(struct drm_connector *connector) { struct panel_connector *panel_connector = to_panel_connector(connector); + drm_sysfs_connector_remove(connector); drm_connector_cleanup(connector); kfree(panel_connector); }