From patchwork Tue May 12 09:14:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 6386571 Return-Path: X-Original-To: patchwork-dri-devel@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 7B719BEEE1 for ; Tue, 12 May 2015 09:12:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A480E203ED for ; Tue, 12 May 2015 09:12:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9799E203EB for ; Tue, 12 May 2015 09:12:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4B976E5BF; Tue, 12 May 2015 02:12:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 903106E5BC; Tue, 12 May 2015 02:12:55 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 12 May 2015 02:12:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,414,1427785200"; d="scan'208";a="724543004" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.152]) by fmsmga002.fm.intel.com with ESMTP; 12 May 2015 02:12:54 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCH RESEND 4/4] drm/sysfs: remove unnecessary connector type checks Date: Tue, 12 May 2015 12:14:55 +0300 Message-Id: <1431422095-20175-4-git-send-email-jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431422095-20175-1-git-send-email-jani.nikula@intel.com> References: <1431422095-20175-1-git-send-email-jani.nikula@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: jani.nikula@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 These attributes should be exposed for the matching connector types only, so checking is redundant. Signed-off-by: Jani Nikula --- drivers/gpu/drm/drm_sysfs.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 34e4fbcf44ba..487ddf5ffe51 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -312,17 +312,6 @@ static ssize_t tv_subconnector_show(struct device *device, uint64_t subconnector; int ret; - switch (connector->connector_type) { - case DRM_MODE_CONNECTOR_Composite: - case DRM_MODE_CONNECTOR_SVIDEO: - case DRM_MODE_CONNECTOR_Component: - case DRM_MODE_CONNECTOR_TV: - break; - default: - DRM_ERROR("Wrong connector type for this property\n"); - return 0; - } - prop = dev->mode_config.tv_subconnector_property; if (!prop) { DRM_ERROR("Unable to find subconnector property\n"); @@ -347,17 +336,6 @@ static ssize_t tv_select_subconnector_show(struct device *device, uint64_t subconnector; int ret; - switch (connector->connector_type) { - case DRM_MODE_CONNECTOR_Composite: - case DRM_MODE_CONNECTOR_SVIDEO: - case DRM_MODE_CONNECTOR_Component: - case DRM_MODE_CONNECTOR_TV: - break; - default: - DRM_ERROR("Wrong connector type for this property\n"); - return 0; - } - prop = dev->mode_config.tv_select_subconnector_property; if (!prop) { DRM_ERROR("Unable to find select subconnector property\n"); @@ -382,11 +360,6 @@ static ssize_t dvii_subconnector_show(struct device *device, uint64_t subconnector; int ret; - if (connector->connector_type != DRM_MODE_CONNECTOR_DVII) { - DRM_ERROR("Wrong connector type for this property\n"); - return 0; - } - prop = dev->mode_config.dvi_i_subconnector_property; if (!prop) { DRM_ERROR("Unable to find subconnector property\n"); @@ -411,11 +384,6 @@ static ssize_t dvii_select_subconnector_show(struct device *device, uint64_t subconnector; int ret; - if (connector->connector_type != DRM_MODE_CONNECTOR_DVII) { - DRM_ERROR("Wrong connector type for this property\n"); - return 0; - } - prop = dev->mode_config.dvi_i_select_subconnector_property; if (!prop) { DRM_ERROR("Unable to find select subconnector property\n");