Received: by 10.192.165.148 with SMTP id m20csp2626452imm; Thu, 26 Apr 2018 14:27:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZogP3/Z5J9UQB2xWEVFB/I597c4EDvpHJy8SRJ1I4JZiExMi7nsw+UsbPoOb8O8ICAhq4yO X-Received: by 10.101.71.203 with SMTP id f11mr3453833pgs.235.1524778044557; Thu, 26 Apr 2018 14:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524778044; cv=none; d=google.com; s=arc-20160816; b=OVJA1ZKlzi2yRrwhf2pdGZwKJ4KnJu/Ov0FuqgqRGzdGtXu/pBOcmamSmVnlzueMsw ey8R0yNV28C0B6tlkQhtpw35qMGMtVELXkA2x4tijKqsmXgwSURdG+8WGILKzRruF/nq zF1m5UPLHN26+C7a7QPTbKLGVWn20vYVRFFidlEmDwgcYMVY07MziJCXrpMV+LmfzR27 ijnhN/LfBA8f+4bVGUT0qo/2I17m6GHki+ntOtQzvtiOhS+ELJRnAvEW/A1ZceDy9reI bbT17dx5utvb/PHSkfML5msBKB/rnZ+g1JAECISpNoEkE20/nUF60CtFvKWtrPQnEaVT 0xvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=FOKIiLggi6rCP7bJXz1zn5cvFm94BkQOZAQ9Fe0aajw=; b=OFB/SbhruNzB3zlNq0F0DS2OK9GX1jAl1CetvSU6ZO92dH+SdzsdkuNIPJLvyHnoJV H2lJX9HpTKgogjNVpJ9wnBTCtDoBqWABTN4h1PFKorLZQm0Tm8/DwE9glE7U+Ec6cQni /csI37VjEURLOEeOYkbGgTY5rF1+ci+xhbvfSlnr/JMZlH9VHYz12kdxLjf1m3TT8DeN efkLxgwWYlP0xYrPmBpuBavonZGRq+BlGMkEcTRxOnuyGpK7BpPBuMHjddAMNuCcYPBD cvhaWQJ+g7Vk6PVOXfiAvm37SPECqNnC+tle5MY5M8YYnmnWrPpHTqRRBpE+x++u+CkU Wwkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VRWbFbYX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6-v6si22181168plp.18.2018.04.26.14.27.07; Thu, 26 Apr 2018 14:27:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VRWbFbYX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756397AbeDZVXf (ORCPT + 99 others); Thu, 26 Apr 2018 17:23:35 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34412 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753973AbeDZVXb (ORCPT ); Thu, 26 Apr 2018 17:23:31 -0400 Received: by mail-pf0-f195.google.com with SMTP id a14so8849404pfi.1; Thu, 26 Apr 2018 14:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FOKIiLggi6rCP7bJXz1zn5cvFm94BkQOZAQ9Fe0aajw=; b=VRWbFbYXX8SwL0DQ9PZLCaSs8FQDU9UZHIRdh5vtVQouIWfZTJeuv/4+OE01yQlgKt vLfk5Y1w1qtrYijU0YADwyGf0ILzWCmz8tpkxQN58F3Sl9Tr7bcK5k8r7JwjOc4UtOIU 0XcFz8LsVgZE0LzMuK5EY6ULYporJ73EU58/d1XcevEmJ8ANtf6TzmDL3FztDuz9TWt/ 953xxm3NXKk1L/uf373Ic0jAkGusAvJYkU3YLzrglWK9xoPu1WINeXmVjZ9TkqZUiSjL Utw6VKL6l40D2uqhv7tWRWs9xc2DujoS/Vj2pKTzBfaQnqpKQ+HKX9tvjJYgxwlBfWwD 3niQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FOKIiLggi6rCP7bJXz1zn5cvFm94BkQOZAQ9Fe0aajw=; b=TtoAaNw5+bZR69y2QjOg6E//WCdUEzxiP01cCzzWpoivwFbAYXZSV8IKX7QMY5q7vq DN05Xi+yTwZrNerq8gnhLZfvJJiPiTC6QvWWZpBbgGcp+XEbpdcjRdw94T1DeqZ+upf4 vVwmtAjOGyBD48XVY/G20OlAnh9cdMKzD1oWc+5r4Y3LSM5jYLfLwWKP7h0s+1NoGopp v2AUOQaaALos4R0+xEFTeyWdsE1GTAdKBfA0Cd61DO9BOuy55WXOP4N0BLnbg/7Pketn hMsMXH8EsMpLlCmiaRpUr4ezkvZX7ob63GtevkazeeoiLlHTjcMEHzx1uz4MaPAYqKU+ HPQg== X-Gm-Message-State: ALQs6tDLgFeySbSHI4CBpeq107qfwWvdOGx8WUbF85NCf3IfXokbjifT 8l44bz+8obHMsHQkXvNJLmI= X-Received: by 10.98.102.221 with SMTP id s90mr30266058pfj.123.1524777810855; Thu, 26 Apr 2018 14:23:30 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id c18sm7308381pgu.63.2018.04.26.14.23.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Apr 2018 14:23:29 -0700 (PDT) Date: Thu, 26 Apr 2018 14:23:27 -0700 From: Dmitry Torokhov To: Wolfram Sang Cc: Wolfram Sang , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Vladimir Zapolskiy , Sylvain Lemieux , Rakesh Iyer , Laxman Dewangan , Thierry Reding , Jonathan Hunter , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH 20/61] input: keyboard: simplify getting .drvdata Message-ID: <20180426212327.GB210716@dtor-ws> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> <20180419140641.27926-21-wsa+renesas@sang-engineering.com> <20180426191947.GC162443@dtor-ws> <20180426200401.lvqiy4gnchkwr4qw@ninjato> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180426200401.lvqiy4gnchkwr4qw@ninjato> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 26, 2018 at 10:04:01PM +0200, Wolfram Sang wrote: > Hi Dmitry, > > > > We should get drvdata from struct device directly. Going via > > > platform_device is an unneeded step back and forth. > > > > I consider the fact that platform device's driver data is accessible via > > device driver data being implementation detail that may or may not change > > Isn't it actually the other way around? platform_get_drvdata() is a > convenience function to access driver_data which is embedded in struct > device? I guess it depends on how you read it. I always considered it separate because none (?) of the bus implementation assert this in comments to XXX_get_drvdata(). > > > in the future, so I'd prefer keep using the proper accessors for the > > objects we are dealing with. > > Exactly. I'd just argue, the object we are dealing with, declared in the > PM functions, is a struct device. No, the driver does not create a generic device, it actually creates a platform device, or i2c client, or spi, or something else. The fact that suspend and resume routines have generic device as their argument has more to do with the language limitation rather than reflection of true type of the objects we are dealing with. Thanks. -- Dmitry