From patchwork Wed Jan 22 10:54:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11345567 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 1B7D61398 for ; Wed, 22 Jan 2020 11:01:30 +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 038F421734 for ; Wed, 22 Jan 2020 11:01:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 038F421734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 BD87E6F4A1; Wed, 22 Jan 2020 11:01:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id B47A56F49E for ; Wed, 22 Jan 2020 10:54:07 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2020 02:54:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,349,1574150400"; d="scan'208";a="221203001" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 22 Jan 2020 02:54:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 37ACA202; Wed, 22 Jan 2020 12:54:03 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Noralf_Tr=C3=B8nnes?= , dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , David Lechner Subject: [PATCH v1 1/4] drm/tiny/repaper: Make driver OF-independent Date: Wed, 22 Jan 2020 12:54:00 +0200 Message-Id: <20200122105403.30035-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 Jan 2020 11:01:18 +0000 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: Andy Shevchenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is one OF call in the driver that limits its area of use. Replace it to generic device_get_match_data() and get rid of OF dependency. While here, cast SPI driver data to certain enumerator type. Signed-off-by: Andy Shevchenko Reviewed-by: Sam Ravnborg --- drivers/gpu/drm/tiny/repaper.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c index 76d179200775..fd9e95ce3201 100644 --- a/drivers/gpu/drm/tiny/repaper.c +++ b/drivers/gpu/drm/tiny/repaper.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -40,6 +40,7 @@ #define REPAPER_RID_G2_COG_ID 0x12 enum repaper_model { + EXXXXCSXXX = 0, E1144CS021 = 1, E1190CS021, E2200CS021, @@ -995,21 +996,21 @@ static int repaper_probe(struct spi_device *spi) { const struct drm_display_mode *mode; const struct spi_device_id *spi_id; - const struct of_device_id *match; struct device *dev = &spi->dev; enum repaper_model model; const char *thermal_zone; struct repaper_epd *epd; size_t line_buffer_size; struct drm_device *drm; + const void *match; int ret; - match = of_match_device(repaper_of_match, dev); + match = device_get_match_data(dev); if (match) { - model = (enum repaper_model)match->data; + model = (enum repaper_model)match; } else { spi_id = spi_get_device_id(spi); - model = spi_id->driver_data; + model = (enum repaper_model)spi_id->driver_data; } /* The SPI device is used to allocate dma memory */ From patchwork Wed Jan 22 10:54:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11345561 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 35F0A924 for ; Wed, 22 Jan 2020 11:01:22 +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 1D5A721734 for ; Wed, 22 Jan 2020 11:01:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D5A721734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 2C0376F49E; Wed, 22 Jan 2020 11:01:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id F36C46F49D for ; Wed, 22 Jan 2020 10:54:06 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2020 02:54:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,349,1574150400"; d="scan'208";a="425815633" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 22 Jan 2020 02:54:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 468E25C; Wed, 22 Jan 2020 12:54:04 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Noralf_Tr=C3=B8nnes?= , dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , David Lechner Subject: [PATCH v1 2/4] drm/tiny/repaper: No need to set ->owner for spi_register_driver() Date: Wed, 22 Jan 2020 12:54:01 +0200 Message-Id: <20200122105403.30035-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200122105403.30035-1-andriy.shevchenko@linux.intel.com> References: <20200122105403.30035-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 Jan 2020 11:01:18 +0000 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: Andy Shevchenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The spi_register_driver() will set the ->owner member to THIS_MODULE. Signed-off-by: Andy Shevchenko Reviewed-by: David Lechner Reviewed-by: Sam Ravnborg --- drivers/gpu/drm/tiny/repaper.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c index fd9e95ce3201..4a497203923f 100644 --- a/drivers/gpu/drm/tiny/repaper.c +++ b/drivers/gpu/drm/tiny/repaper.c @@ -1198,7 +1198,6 @@ static void repaper_shutdown(struct spi_device *spi) static struct spi_driver repaper_spi_driver = { .driver = { .name = "repaper", - .owner = THIS_MODULE, .of_match_table = repaper_of_match, }, .id_table = repaper_id, From patchwork Wed Jan 22 10:54:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11345563 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 3AD5B924 for ; Wed, 22 Jan 2020 11:01:25 +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 2322421734 for ; Wed, 22 Jan 2020 11:01:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2322421734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 958B96F4A0; Wed, 22 Jan 2020 11:01:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 789916F49F for ; Wed, 22 Jan 2020 10:54:07 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2020 02:54:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,349,1574150400"; d="scan'208";a="250579491" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Jan 2020 02:54:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4BB4D29B; Wed, 22 Jan 2020 12:54:04 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Noralf_Tr=C3=B8nnes?= , dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter , David Lechner Subject: [PATCH v1 3/4] drm/tiny/st7735r: Make driver OF-independent Date: Wed, 22 Jan 2020 12:54:02 +0200 Message-Id: <20200122105403.30035-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200122105403.30035-1-andriy.shevchenko@linux.intel.com> References: <20200122105403.30035-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 Jan 2020 11:01:18 +0000 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: Andy Shevchenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is one OF call in the driver that limits its area of use. Replace it to generic device_get_match_data() and get rid of OF dependency. Signed-off-by: Andy Shevchenko Acked-by: David Lechner --- drivers/gpu/drm/tiny/st7735r.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c index 32574f1b6071..a844cde6d14a 100644 --- a/drivers/gpu/drm/tiny/st7735r.c +++ b/drivers/gpu/drm/tiny/st7735r.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include