From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 23 Dec 2021 17:06:00 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n0QbQ-00Fsbi-MU for lore@lore.pengutronix.de; Thu, 23 Dec 2021 17:06:00 +0100 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n0QbO-0008Cf-R8 for lore@pengutronix.de; Thu, 23 Dec 2021 17:06:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RNFNWfAVEd412h3R2sh4uzW0T8Q/7arGUUM4MgRF+ck=; b=Ng0UcqzI5aIJxQ RSRpbYMqK7i4JBcT7xKYqfoTwkKN91YK9LZ6yUav2oCvkYqKB0C9xYW3Wa+geVVomgE/faCj0HHC1 Ojv0u4eJzM3ySCRM2NgZkzlov5XxTeeGRyhTD9LRmUSMtzw6aK5VM+XLn1AUa1bpMtvyJkmSqbuS6 oJe7P30pUMH91y2hIW/ckIVxm1DQvj+NzQPu20g7lzVGWdX+Vr90eRQoDH6fV+4ffT7kTG3nCLjHZ PyVriyYnnWm5IzoS4f/YOQEmZKmiKwMSgiSDPA1jFvmed2CE2I5gap/8K3Bjf1mRFfvNyWdCXWbsR nw1yBV/X92QUTwdURoQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0QZr-00D0b7-Ht; Thu, 23 Dec 2021 16:04:23 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0QZe-00D0XU-IK for barebox@lists.infradead.org; Thu, 23 Dec 2021 16:04:13 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n0QZb-0007fu-Er; Thu, 23 Dec 2021 17:04:07 +0100 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1n0QZb-006DLH-Dw; Thu, 23 Dec 2021 17:04:06 +0100 Received: from mtr by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1n0QZY-000VE2-Sb; Thu, 23 Dec 2021 17:04:04 +0100 From: Michael Tretter To: barebox@lists.infradead.org Cc: m.tretter@pengutronix.de Date: Thu, 23 Dec 2021 17:04:02 +0100 Message-Id: <20211223160404.119970-7-m.tretter@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211223160404.119970-1-m.tretter@pengutronix.de> References: <20211223160404.119970-1-m.tretter@pengutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_080410_630980_C03C5BC4 X-CRM114-Status: GOOD ( 12.52 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:e::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.5 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: [PATCH v2 6/8] video: ssd1307fb: move i2c setup to single place X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) By having the entire i2c dependent initialzation in a single place, it is easier to make it optional later. Signed-off-by: Michael Tretter --- Changelog: v2: none --- drivers/video/ssd1307fb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c index 88c88e3253cf..1538a1b640a3 100644 --- a/drivers/video/ssd1307fb.c +++ b/drivers/video/ssd1307fb.c @@ -387,7 +387,6 @@ static const struct of_device_id ssd1307fb_of_match[] = { static int ssd1307fb_probe(struct device_d *dev) { - struct i2c_client *client = to_i2c_client(dev); struct fb_info *info; struct device_node *node = dev->device_node; const struct of_device_id *match = @@ -410,10 +409,12 @@ static int ssd1307fb_probe(struct device_d *dev) info->priv = par; par->info = info; - par->client = client; par->device_info = (struct ssd1307fb_deviceinfo *)match->data; + par->client = to_i2c_client(dev); + i2c_set_clientdata(par->client, par); + par->reset = of_get_named_gpio_flags(node, "reset-gpios", 0, &of_flags); if (!gpio_is_valid(par->reset) && par->reset == -EPROBE_DEFER) { @@ -519,8 +520,6 @@ static int ssd1307fb_probe(struct device_d *dev) if (ret < 0) goto reset_oled_error; - i2c_set_clientdata(client, info); - if (par->reset > 0) { /* Reset the screen */ gpio_set_active(par->reset, 1); -- 2.30.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox