From patchwork Wed Mar 5 16:12:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 3777291 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 848E09F1EE for ; Wed, 5 Mar 2014 16:13:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5B0420256 for ; Wed, 5 Mar 2014 16:13:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA48B2024C for ; Wed, 5 Mar 2014 16:13:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754957AbaCEQNF (ORCPT ); Wed, 5 Mar 2014 11:13:05 -0500 Received: from mail-bk0-f44.google.com ([209.85.214.44]:42479 "EHLO mail-bk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754868AbaCEQND (ORCPT ); Wed, 5 Mar 2014 11:13:03 -0500 Received: by mail-bk0-f44.google.com with SMTP id mz13so490929bkb.31 for ; Wed, 05 Mar 2014 08:13:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FG0qgqDzLoUOrxoP6Lsz8DIRTU8o6BaR6HfuNLedLf4=; b=UGgSqv+nXzYoJgzmPM7SerYSK4RidwufrRk9KmuUVJWkVTtIBjxe+6xfczs5TWfZyW Qou/KKCzOQ0AdfP6M08UBFnvYq5lr3TbQcSW+ySz0Aw2yazXhRPLZGwVtTg+Z5kIntV3 z0SaevXDWzq1a06hfBLqLn5MulMsXa5+THD8/hX2SxggHKcjtuOPvLSa/9NAk/TbgG8H 6zb43cS6E1QNKiSzKcWIRImmXBevMwbX+sibfL2d1HmPEfdQQIdF/F3+uLV7pHimMo0J HLDB+ahOdi+N8hZRmbz5T6yp5MxWLh0NR8svk+tUl1FVT0SYWx2lKGJkW4FIAqx4HBgU EaCA== X-Received: by 10.204.54.74 with SMTP id p10mr34589bkg.169.1394035982712; Wed, 05 Mar 2014 08:13:02 -0800 (PST) Received: from tamtam.fritz.box (p5099deeb.dip0.t-ipconnect.de. [80.153.222.235]) by mx.google.com with ESMTPSA id r1sm5501787bkk.2.2014.03.05.08.13.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Mar 2014 08:13:01 -0800 (PST) From: Daniel Mack To: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: linux-fbdev@vger.kernel.org, haojian.zhuang@gmail.com, eric.y.miao@gmail.com, Daniel Mack Subject: [PATCH 3/4] video: pxa3xx-gcu: provide an empty .open call Date: Wed, 5 Mar 2014 17:12:48 +0100 Message-Id: <1394035969-32420-4-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1394035969-32420-1-git-send-email-zonque@gmail.com> References: <1394035969-32420-1-git-send-email-zonque@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 This is necessary in order to make the core set file->private_data to miscdev in use. We need that information later to dereference the container of the device, so we can get access to our private struct from other callbacks. Signed-off-by: Daniel Mack --- drivers/video/pxa3xx-gcu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c index f9961ba..73c29ec 100644 --- a/drivers/video/pxa3xx-gcu.c +++ b/drivers/video/pxa3xx-gcu.c @@ -373,6 +373,15 @@ static inline struct pxa3xx_gcu_priv *to_pxa3xx_gcu_priv(struct file *file) return container_of(dev, struct pxa3xx_gcu_priv, misc_dev); } +/* + * provide an empty .open callback, so the core sets file->private_data + * for us. + */ +static int pxa3xx_gcu_open(struct inode *inode, struct file *file) +{ + return 0; +} + static ssize_t pxa3xx_gcu_write(struct file *file, const char *buff, size_t count, loff_t *offp) @@ -571,6 +580,7 @@ pxa3xx_gcu_free_buffers(struct device *dev, static const struct file_operations pxa3xx_gcu_miscdev_fops = { .owner = THIS_MODULE, + .open = pxa3xx_gcu_open, .write = pxa3xx_gcu_write, .unlocked_ioctl = pxa3xx_gcu_ioctl, .mmap = pxa3xx_gcu_mmap,