From patchwork Thu Oct 29 23:23:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Antognolli X-Patchwork-Id: 7522101 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 999AEBEEA4 for ; Thu, 29 Oct 2015 23:23:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5543208AB for ; Thu, 29 Oct 2015 23:23:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5678620897 for ; Thu, 29 Oct 2015 23:23:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D9C1F6E694; Thu, 29 Oct 2015 16:23:26 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 49F8A6E2E4; Thu, 29 Oct 2015 16:23:20 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 29 Oct 2015 16:23:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,216,1444719600"; d="scan'208";a="806978082" Received: from di-604.jf.intel.com (HELO apicaltest.jf.intel.com) ([10.7.199.92]) by orsmga001.jf.intel.com with ESMTP; 29 Oct 2015 16:23:18 -0700 From: Rafael Antognolli To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Thu, 29 Oct 2015 16:23:46 -0700 Message-Id: <1446161026-18708-3-git-send-email-rafael.antognolli@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1446161026-18708-1-git-send-email-rafael.antognolli@intel.com> References: <1446161026-18708-1-git-send-email-rafael.antognolli@intel.com> Subject: [Intel-gfx] [PATCH v6 2/2] drm/dp: Set aux.dev to the drm_connector device, instead of drm_device. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 So far, the i915 driver and some other drivers set it to the drm_device, which doesn't allow one to know which DP a given aux channel is related to. Changing this to be the drm_connector provides proper nesting, still allowing one to get the drm_device from it. Some drivers already set it to the drm_connector. This also removes the need to add a sysfs link for the i2c device under the connector, as it will already be there. Signed-off-by: Rafael Antognolli --- drivers/gpu/drm/i915/intel_dp.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 8287df4..7aacc08 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1078,36 +1078,21 @@ intel_dp_aux_init(struct intel_dp *intel_dp, struct intel_connector *connector) intel_dp->aux_ch_ctl_reg = intel_dp->output_reg + 0x10; intel_dp->aux.name = name; - intel_dp->aux.dev = dev->dev; + intel_dp->aux.dev = connector->base.kdev; intel_dp->aux.transfer = intel_dp_aux_transfer; DRM_DEBUG_KMS("registering %s bus for %s\n", name, connector->base.kdev->kobj.name); ret = drm_dp_aux_register(&intel_dp->aux); - if (ret < 0) { + if (ret < 0) DRM_ERROR("drm_dp_aux_register() for %s failed (%d)\n", name, ret); - return; - } - - ret = sysfs_create_link(&connector->base.kdev->kobj, - &intel_dp->aux.ddc.dev.kobj, - intel_dp->aux.ddc.dev.kobj.name); - if (ret < 0) { - DRM_ERROR("sysfs_create_link() for %s failed (%d)\n", name, ret); - drm_dp_aux_unregister(&intel_dp->aux); - } } static void intel_dp_connector_unregister(struct intel_connector *intel_connector) { - struct intel_dp *intel_dp = intel_attached_dp(&intel_connector->base); - - if (!intel_connector->mst_port) - sysfs_remove_link(&intel_connector->base.kdev->kobj, - intel_dp->aux.ddc.dev.kobj.name); intel_connector_unregister(intel_connector); }