Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp70034ybt; Mon, 6 Jul 2020 04:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp4F/QHXDtki2f22hU5tgQ7UBnRDvf03BCKuNO5HxD9p47bgHY8Rvl50vKFbWjZDLGw6Yi X-Received: by 2002:a17:906:945:: with SMTP id j5mr43191196ejd.52.1594034522735; Mon, 06 Jul 2020 04:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594034522; cv=none; d=google.com; s=arc-20160816; b=zeLda00IniZwj4WcK+P426i8fthSOfFcXIl9sjEIhBObE/9bBWI0WuR2Rhs53Cs+Cz yfpNvAx07Uig8DSTtPLV+RFVTZ+m82y3lfEdwAS+nju2aYXytQsyidhHYJvbCCt28rR/ Lmvqoi7wO2PBYEOHQKCh/SP/jlZQFI6m6sLzE8IUy8rGsUpASd0/UPdOqmlsoXJ8Op70 rXXq8lSi8TG0Egg7+p7lQEMhWYBqnwgcRFcJAmCAQUEFrx6/YIF6izAQK8g/lEXfYLgr sGwmuW5YuRzS+7cCNR2povqE8CwMNeqDbkMO4h4SUnHC/C8WLHz+ke8l0W7+2IsdtIjt CDjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eaKkoa6OtK9ushlhbRsOllZl1SkbmcFyigdDIq8+K+E=; b=B4GLms+dIUFsqUbPLdnD7UNeEF5M7uV48A2prx5x/aD7gN9LLrn76I59i+WVsuxDw4 khKY3Jv1ElCN3cwiB7VQZJmxE/CilJ04CByl9Njr0RGJg5/H343WpXpVysKzVKRcGTf/ AFvELIwiMUNRbD5rfP7A3XI6XyTRgZUwRnUDAjQmecCMKuK9x7an+x4i/Znc2QIfgwsZ +2GxhPf2k6pta9kILAQMooO8R60bIEZA7OxDhd99cSORtUHFcE9OZHERLXPTwfdbNzL9 tYnHh2MxTPwyr2d3B4tCFO876RcRJFvltSxwjMsiURqNAaTf/XSwpOXtgtwsvAfnp0Ey +FQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=KFKjgcxG; 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 p91si15312228edb.129.2020.07.06.04.21.39; Mon, 06 Jul 2020 04:22:02 -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=KFKjgcxG; 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 S1728899AbgGFLVa (ORCPT + 99 others); Mon, 6 Jul 2020 07:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728871AbgGFLVa (ORCPT ); Mon, 6 Jul 2020 07:21:30 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE1C8C08C5E0 for ; Mon, 6 Jul 2020 04:21:29 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id p7so16977792qvl.4 for ; Mon, 06 Jul 2020 04:21:29 -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; bh=eaKkoa6OtK9ushlhbRsOllZl1SkbmcFyigdDIq8+K+E=; b=KFKjgcxGJuWiNXupkKc/WX+BRn9eaPo70uMCjtxoRwexDUqyKLPR74ag+pyo2iHje0 fWce7QcRP/v0WSiBq2IGXHYY069VP7xOrsRtEFB/lqWESZ2JruZ5NfI8nkTw+9rxJBhT O4WbVRTd40L4Gk8K67XZ6YpvWv+7OE/aSdrMoDYvvjPf12jW690Wx3eJscAg4bBqmG45 8b7vuh3Zql+rrZ7jgLMzJqZUghlcg1Ij2VJNrxch1PGF+q9099PPddonHkIhYWbM4MXB Gle3lOnMaPrTAMZ1r5+RlaX8/GRDOVigZj0gn+PU6z1ykVa5L9TPh+1vrnAT5Xl3bOKs qBSw== 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; bh=eaKkoa6OtK9ushlhbRsOllZl1SkbmcFyigdDIq8+K+E=; b=S5okmXbxjsDmYqArDb3vFuARoqTnY4LeJNitt2Yj97aErXl2Oq+BU+8MxBcHJ7nzST PWavv5CCQzfFDU74+PqPXwfL90g0sIO5SIbUuYzyG2qlTnZiVh1NKoGDV0IqXQiqpf7f TNjZCVDKCf2VPrcqaJK1UO/cGh5YCTQjgywuynzBsZQce3pAB1UZGy3n+FurzHg+1FiW R+EcGe7RRdeQfTpIX3upr/W2X71zINtwvAw7u+w3u7c9LP+wLtAPz2J52UsDWhhy5qLi PVNSWP5bWIvKr+EE9GN3Fu2VGa332icpavIz9xQoy7+/mQhoTL4vFxpvzTQYrSMXMxRA G9CQ== X-Gm-Message-State: AOAM533ilJd/W3lF/BBn4zBtCTzu9vye9lGC5qUbBxhNMRRYfqszcbmB OO8NDcQ1g6yWYniwsTclftHVsle3IuiokPukIwCV5Q== X-Received: by 2002:a05:6214:72c:: with SMTP id c12mr43869344qvz.76.1594034488967; Mon, 06 Jul 2020 04:21:28 -0700 (PDT) MIME-Version: 1.0 References: <20200705133038.161547-1-mans0n@gorani.run> In-Reply-To: <20200705133038.161547-1-mans0n@gorani.run> From: Bartosz Golaszewski Date: Mon, 6 Jul 2020 13:21:18 +0200 Message-ID: Subject: Re: [PATCH v5 1/2] gpio: add GPO driver for PCA9570 To: Sungbo Eo Cc: Linus Walleij , Andy Shevchenko , Michael Walle , LKML , linux-gpio Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 5, 2020 at 3:31 PM Sungbo Eo wrote: > > NXP PCA9570 is a 4-bit I2C GPO expander without interrupt functionality. > Its ports are controlled only by a data byte without register address. > > Datasheet: https://www.nxp.com/docs/en/data-sheet/PCA9570.pdf > > Signed-off-by: Sungbo Eo > --- > v5: > * amended the commit message > * removed unnecessary castings > * added data to of_match_table > > v4: > * removed ->direction_input() and ->direction_output() > (Seems unnecessary to me) > * removed ->set_multiple() > (I'm not sure this implementation is really correct) > * added ->get() > (DS says we can read the status from the device) > * read current status during probe > > v3: > * remove mutex > * rename buffer to out > * simplify return statements > * replace ->probe() to ->probe_new() > * move ngpio to driver_data > (PCA9571 is 8-bit so I thought making ngpio configurable is a good idea) This driver looks nice now but why did you remove the mutex in v3? I think when Andy commented on that, he meant not understanding why the error check is protected, not the i2c operations. Are you sure you don't need this lock? Bartosz