Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1484332ybt; Mon, 15 Jun 2020 01:11:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHojGZ+exF5Txo+vlBMb0C2S6FVpzOwPzZWKiFWqY3PR+apuSZ6f69pe2lW4eWLIAASjLS X-Received: by 2002:a17:906:48d8:: with SMTP id d24mr24171035ejt.369.1592208682497; Mon, 15 Jun 2020 01:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592208682; cv=none; d=google.com; s=arc-20160816; b=m1ZQRJSMemGdUUNYzgDfvH8bJSTj+N3L4Rq2VG431ozG528bpn4KBijpt4ImKMxy8U Lvtk2APWAZ1DKfLwEVb3ziaJt/7/Mp8AHR1Hq5cKE+rrSqrW5XXx0Fg0umnSRL4PBpTw fphP5orRhzzr7xZsoxtb83GZ72hk2KPk13ftd91o6wMjsgAMpBWENs0YNy23IRbvRq0U eamdGxYEJa/zu5oM2koPFItwOcIKke7+1guPCIgEwJrNN6UQZBcq900GefoA1Z4/5d8O OPLmegH/XYQp75ssVGQIJAQ+wsrrpJmv1UmlqffYhIV4vG9k0eZf7kzB4zOWYbR/amGL SjhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VdhQIqsA76M/Q33FgsDVqlY0C8ahxL1l23f83ZhasWY=; b=fiZPYNo5aVVYIG5gfL2QM07y2mJMjcONCDoB07DAX5D1E5ofGncNB1pPkEmUbZBPa7 2pJvEHv08bhbYLJJ9MCqYB0itlWJZxFiAcSFtXdc51X+b4Bpg2t/Gjv66KkBRI0uZ1BD SMEEi547WnODdfwNzr/PS+ngE7Z1ZpWF1oM8ELhPB9HtXoq2ZroXMyLuvEmXQbXqXngB JgwA8uSVVFc8c2j7e1TlFd+WX5amAGqv6F9REJovLEnKolFElWWw4Tvp+QzgJYkbPl+N WIe0DSCmhFP5JYlQ1Q+j9YXGuuu63uoDf23TfcL/wUWwSq7txW34UxEeN0i4+x7hfPRC BNpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=BauVPoy1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si2362985ejm.51.2020.06.15.01.10.59; Mon, 15 Jun 2020 01:11:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=BauVPoy1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728948AbgFOIIZ (ORCPT + 99 others); Mon, 15 Jun 2020 04:08:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728782AbgFOIIY (ORCPT ); Mon, 15 Jun 2020 04:08:24 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B030C05BD43 for ; Mon, 15 Jun 2020 01:08:24 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id q8so14871974qkm.12 for ; Mon, 15 Jun 2020 01:08:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VdhQIqsA76M/Q33FgsDVqlY0C8ahxL1l23f83ZhasWY=; b=BauVPoy18r5Ja+XGXEFsim5pmCPUyMhnejZLHUj0k3XMJEuNoeusyhSt4/yuE9zccG /bbwwKWRd5U9e7DFvXo94AmRf4ZT/Sy8wxIa0WqUfRIdtM8+3PxPIGgGZDZ7Vh3SYYbK K79hViEWQKSjAGTZ/Ra4lE4BEsK8uBrS9GI3U9a0dfPnICySLMuH3S5BDWKBR46JkaJk VP0TeeKtBrZBcj/NldzPmSJzP/jTu494o9ZUJD7RrE7c9+8B0VhY8elkze24uPHTjMTp mWDlHzyBYiTOY0Wx6vjSKjHBpUXURgi5a3Xra9YUnsmbCV5RRyd9E23zy6DQT/H2czPt G4NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VdhQIqsA76M/Q33FgsDVqlY0C8ahxL1l23f83ZhasWY=; b=c/RbvO2G1iG68QRbzU21R8MgfXWjCPAGNDMbx8rj7tkQ3oRNwWs0xlKqflpDuu7h4S kLe0EMApHtwVqEDjr4PhEmBSXLUPIgpm+jQu5qYrX3ldoFqzevSJHT02mzRIFPGUGb+E COkStMZwWP9BiRlHhinFQWAHDjY70+S4T7N6oO8cM4j1pSykJ8M/TKi+ANC9kIQhlEAd LIJf95iAeqmp8mA9LhZVMCf/jcQCBmGMox1MTSjv9mPo6TEGqzDwB6/nbmlogb1syKog hLnZxmmKsTEo+s5UjJyUa3T0kUGrLGIPQ8KunF/53RSVt549/+aE1RLiot7fm8bWn6SI G3gA== X-Gm-Message-State: AOAM530+ftZoHuxlU+2fWWH+5xAPTkjJGdAMoSyywZfk+ajISKoMGULR CcA4CfJa1gqGo4mG3prsy5Ueuq2M8uvaZ9qG6IfXjeLF X-Received: by 2002:a37:a643:: with SMTP id p64mr13171662qke.21.1592208503807; Mon, 15 Jun 2020 01:08:23 -0700 (PDT) MIME-Version: 1.0 References: <1591949145-17098-1-git-send-email-wangqing@vivo.com> In-Reply-To: <1591949145-17098-1-git-send-email-wangqing@vivo.com> From: Bartosz Golaszewski Date: Mon, 15 Jun 2020 10:08:13 +0200 Message-ID: Subject: Re: [PATCH] drivers\gpio: use kobj_to_dev To: Wang Qing Cc: Linus Walleij , linux-gpio , LKML , opensource.kernel@vivo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pt., 12 cze 2020 o 10:05 Wang Qing napisa=C5=82(a): > > Use kobj_to_dev() API instead of container_of(). > > Signed-off-by: Wang Qing > --- > drivers/gpio/gpiolib-sysfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > mode change 100644 =3D> 100755 drivers/gpio/gpiolib-sysfs.c > > diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c > index 23e3d33..82371fe > --- a/drivers/gpio/gpiolib-sysfs.c > +++ b/drivers/gpio/gpiolib-sysfs.c > @@ -365,7 +365,7 @@ static DEVICE_ATTR_RW(active_low); > static umode_t gpio_is_visible(struct kobject *kobj, struct attribute *a= ttr, > int n) > { > - struct device *dev =3D container_of(kobj, struct device, kobj); > + struct device *dev =3D kobj_to_dev(kobj); > struct gpiod_data *data =3D dev_get_drvdata(dev); > struct gpio_desc *desc =3D data->desc; > umode_t mode =3D attr->mode; > -- > 2.7.4 > Patch applied, thanks! Bartosz