From patchwork Thu Dec 21 13:22:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jasmin J." X-Patchwork-Id: 46154 Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRzsL-0003jG-5z; Thu, 21 Dec 2017 12:23:01 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753416AbdLUMW7 (ORCPT + 1 other); Thu, 21 Dec 2017 07:22:59 -0500 Received: from mail.anw.at ([195.234.101.228]:36243 "EHLO mail.anw.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753350AbdLUMW6 (ORCPT ); Thu, 21 Dec 2017 07:22:58 -0500 Received: from localhost.localdomain (node-knx.pool-1-2.dynamic.totbb.net [1.2.232.157]) by mail.anw.at (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id vBLCMnmk030158; Thu, 21 Dec 2017 13:22:53 +0100 From: "Jasmin J." To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, rjkm@metzlerbros.de, d.scheller@gmx.net, jasmin@anw.at Subject: [PATCH V2 1/3] media: dvb-core: Store device structure in dvb_register_device Date: Thu, 21 Dec 2017 13:22:37 +0000 Message-Id: <1513862559-19725-2-git-send-email-jasmin@anw.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513862559-19725-1-git-send-email-jasmin@anw.at> References: <1513862559-19725-1-git-send-email-jasmin@anw.at> X-Antivirus: checked in 0.017sec at mail.anw.at ([195.234.102.72]) by smf-clamd v1.2.1 - http://smfs.sf.net/ Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Jasmin Jessich The device created by device_create in dvb_register_device was not available for DVB device drivers. Added "struct device *dev" to "struct dvb_device" and store the created device. Signed-off-by: Jasmin Jessich Acked-by: Ralph Metzler --- drivers/media/dvb-core/dvbdev.c | 1 + drivers/media/dvb-core/dvbdev.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 060c60d..f55eff1 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -538,6 +538,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, __func__, adap->num, dnames[type], id, PTR_ERR(clsdev)); return PTR_ERR(clsdev); } + dvbdev->dev = clsdev; dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", adap->num, dnames[type], id, minor, minor); diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h index bbc1c20..1f2d2ff 100644 --- a/drivers/media/dvb-core/dvbdev.h +++ b/drivers/media/dvb-core/dvbdev.h @@ -147,10 +147,11 @@ struct dvb_adapter { * @tsout_num_entities: Number of Transport Stream output entities * @tsout_entity: array with MC entities associated to each TS output node * @tsout_pads: array with the source pads for each @tsout_entity + * @dev: pointer to struct device that is associated with the dvb device * * This structure is used by the DVB core (frontend, CA, net, demux) in * order to create the device nodes. Usually, driver should not initialize - * this struct diretly. + * this struct directly. */ struct dvb_device { struct list_head list_head; @@ -183,6 +184,7 @@ struct dvb_device { #endif void *priv; + struct device *dev; }; /**