From patchwork Sat Jun 7 03:02:01 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: 4314991 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 171D3BEECB for ; Sat, 7 Jun 2014 03:01:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5112120127 for ; Sat, 7 Jun 2014 03:01:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3784B2020F for ; Sat, 7 Jun 2014 03:01:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752573AbaFGDBU (ORCPT ); Fri, 6 Jun 2014 23:01:20 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]:41296 "EHLO mail-vc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752564AbaFGDBT (ORCPT ); Fri, 6 Jun 2014 23:01:19 -0400 Received: by mail-vc0-f170.google.com with SMTP id lc6so4105557vcb.29 for ; Fri, 06 Jun 2014 20:01:18 -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=Zz2jBi/m39gFoG9qR19Pgd4GfbDzq4/sRr40RzZ9KeU=; b=W4BAkUBlzZ5b/S1MLSwvIVhPz0Y5v6/zNhFtWwkbA9KGyLgFFmW4rcI1sKYOUB8bfP BpOonEUdghK9U5L9p26oT3z349aHUytP7lcuORB2rwuJfI8PishmkJh95jyPu9S2PZV+ cvgbV24cf6md439/J57lzOXqIWhrbTRNlKUSwzRJWo33EXWrr6dqWPVMwYayqZy1zz87 jnITDYAaN2B/aiNEI2qB4kIh78q7aMUFXM92m7y/UEfg4mtl3ddwDpPT5/D/PHjeOLyW RebwslTQsxg4MfhPL4NxL9jWWB7mMi9nsrMurWtMwi+JoLmtwuCZV71qnhn3ZxgV/Sh3 OAXQ== X-Gm-Message-State: ALoCoQkvEO/BzwMOb2CYA6rthmxQbV/yph/1YBRHrRKCKTnhJaE3GrIXZLuupeAcoq/sk4naDjbl X-Received: by 10.58.248.2 with SMTP id yi2mr8365086vec.48.1402110078790; Fri, 06 Jun 2014 20:01:18 -0700 (PDT) Received: from localhost (host18.190-30-94.telecom.net.ar. [190.30.94.18]) by mx.google.com with ESMTPSA id pb10sm13926863vec.17.2014.06.06.20.01.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 20:01:17 -0700 (PDT) From: =?UTF-8?q?Guido=20Mart=C3=ADnez?= To: dri-devel@lists.freedesktop.org, linux-arm-kernel@vger.kernel.org, linux-omap@vger.kernel.org Cc: =?UTF-8?q?Ezequiel=20Garc=C3=ADa?= , David Airlie , Russell King , Rob Clark , Tony Lindgren , Daniel Mack , =?UTF-8?q?Guido=20Mart=C3=ADnez?= , stable@vger.kernel.org Subject: [PATCH 2/9] drm/tilcdc: panel: fix dangling sysfs connector node Date: Sat, 7 Jun 2014 00:02:01 -0300 Message-Id: <1402110128-30471-3-git-send-email-guido@vanguardiasur.com.ar> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <1402110128-30471-1-git-send-email-guido@vanguardiasur.com.ar> References: <1402110128-30471-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.5 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: stable@vger.kernel.org --- 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); }