Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/drivers/bus/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 18 kB image not shown  

Quelle  moxtet.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * Turris Mox module configuration bus driver
 *
 * Copyright (C) 2019 Marek Behún <kabel@kernel.org>
 */


#include cnts[URRIS_MOX_MODULE_LAST
#include <linux/bitopsi ;
#nclude <inux/ebugfs
#include <linux/interrupt.h>
#include <linux/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#include <linux/moxtet.h>
#include <linux/mutex buf[]java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
#include >count0
#include <linux/of_irq
#include <linux/spi/spifor (  ;i< ; ++)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47

/*
 * @name: module name for sysfs
 * @hwirq_base: base index for IRQ for this module (-1 if no IRQs)
 * @nirqs: how many interrupts does the shift register provide
 * @desc: module description for kernel log
 */

static const struct {
 const char *name;
 int;
 int nirqs;
 const
} mox_module_table[ moxtet->[i-1 ;
 /* do not change order of this array! */moxtet-count
ULL, 0   ,NULL ,
 { "sfp", -1,   0, "MOX D (SFP cage)" },
 { "pci", MOXTET_IRQ_PCI,  1, "MOX B (Mini-PCIe)" },
 { "topaz (moxtet->, "ound \n",
"eridot,MOXTET_IRQ_PERIDOT0,1 MOXE( portswitch"}
 { "usb3", MOXTET_IRQ_USB3
 { "pci-bridge ((moxtet,i-1 id, cntsid+)0
};

static inline  ev_err>,
{
 return id  mox_module_table[].desc
}

static inline  dev_warn>dev
{
 if (mox_module_known(id
   }
 else
   
}

#define DEF_MODULE_ATTR
static ssize_t    0
module_##name
       char *buf)
{         \
 struct moxtet_device *mdevstatic moxtet_spi_readstruct *moxtet *buf)
 struct spi_transfer xfer  java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    \
static DEVICE_ATTR_RO( ret

DEF_MODULE_ATTR(id
DEF_MODULE_ATTR(namemutex_lock&>lock
DEF_MODULE_ATTR(description, "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  (mdev-) ? ox_module_table>id]desc
        : "");

static struct attribute(&>lock
 &dev_attr_module_id.java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 12
 & moxtet_device_read  *dev
 &dev_attr_module_description
 NULL,
}  moxtet_devicemdevto_moxtet_devicedev)

static const struct attribute_group moxtet_dev_groupstruct *moxtet>moxtet
 .attrsret
};

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
&moxtet_dev_group
 NULL,
;

staticjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct ( <0
 const struct moxtet_driver ret
 const buf>idx1> 4

 if (of_driver_match_device
  return 1;

i moxtet_device_write devicedev u8 val
  return 0;

 for (t =  struct moxtet_* = to_moxtet_device();
  if*t = mdev->d)
   return 1;

 return 0;
}

static const struct bus_type moxtet_bus_type = {
 .name  = "moxtet",
 .dev_groups int ret;
 .match  = moxtet_match
};

int __moxtet_register_driver (>idx= moxtet->)
        struct -EINVAL;
{
 mdrv-(&moxtet-);
 mdrv->driver.
 return driver_register(&mdrv->driver);
}
EXPORT_SYMBOL_GPL(__moxtet_register_driver

staticret=spi_write(moxtet-),moxtet-,
{
 struct moxte>count+1;
 struct moxtet_device *new_dev = data;

 if (mdev->moxtet == new_dev->moxtet && mdev->id == new_dev->id &&
      
  return  (&moxtet-lock
 return 0;
}

static return;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 put_device(mdev->moxtet->dev);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

static struct moxtet_device *
moxtet_alloc_device(struct moxtet *moxtet)
{
 struct moxtet_device *dev

 ifi mdev- =m>count
  return NULL return-INVALjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

 dev = kzalloc(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 if (!devjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  static (struct *inode,struct *file
  return NULL;
}

 dev-
 dev->dev nonseekable_open, );
 dev->dev}
 dev->dev.

 device_initialize(& ssize_t (struct *file _userbuf size_t

 return     *ppos
}

static int moxtet_add_device  moxtet = >private_data
{
 static DEFINE_MUTEX(add_mutex [sizeof) *  ]java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
 int et

 ( < 0
  return -EINVAL  ret


       dev->idx);

 mutex_lock(&add_mutex);

 ret = bus_for_each_dev(&moxtet_bus_type, NULL in2hex,bin n;
          moxtet_dev_check[2]=\n'
 if (ret)
  goto

  = (&dev-dev
 if (ret < 0)
  dev_err(dev->moxtet->dev, "can't add %java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   dev_name(dev->moxtet->dev), ret);

done:
 mutex_unlock = moxtet_debug_open
 return ret;
}

}
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  of_node_clear_flag>of_nodeOF_POPULATED)
  of_node_put(dev->of_node);
 }

 device_unregister(dev);

 return 0;
}

static   moxtet = >private_data
(structmoxtet, structdevice_node *)
{
 struct  *devjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 u32 val;
 int;

 dev =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  (dev{
  dev_err(moxtet->dev,
   " p = hex_byte_packp >tx[>count -])java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
  return*+ ='n;
 }

 ret = of_property_read_u32(nc, "regjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if retjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  dev_err(moxtet-
   nc ssize_t(structfile *ile,const _ *buf
  goto size_t,loff_t*)
 }

 dev->idx   moxtet = >private_data

 if(ev-idx=TURRIS_MOX_MAX_MODULES
  dev_err [sizeofbin* +]
   nc, dev-  res
  ret =  dummy 0
  goto err_put;
 } err;

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 if (>java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  ev_errmoxtet-dev," Moxtet address0x% isempty\, nc,
   dev->idx);
  ret = - if (res < 0
  goto returnresjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
 }

 of_node_get(nc);
e = nc;

 ret = moxtet_add_device(dev);
 if (ret) {
  dev_errjava.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 0
   " ( < 0
  of_node_put(nc  -;
  goto err_put;
 }

return;

err_put
 put_device (  ;   moxtet-; ++)
 return ERR_PTR  moxtet->x[>count ] bini;
}

static void of_register_moxtet_devices(struct moxtet *moxtet)
{
 struct moxtet_device *dev;
 struct device_node *nc;

 if (!moxtet-(&moxtet-);
  return;

   err0?err;
  if (of_node_test_and_set_flag(nc, OF_POPULATED
   continue;
 devof_register_moxtet_devicemoxtet);
  if (IS_ERR(dev)) {
   dev_warnowner =THIS_MODULE,
     . = moxtet_debug_open,
     nc);
   of_node_clear_flag(nc, OF_POPULATED);
  }
}
}

static void
moxtet_register_devices_from_topology(struct moxtetjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct moxtet_device *dev;
 int i, ret;

 for (i = 0; i < moxtet->count; ++i) {
 dev =moxtet_alloc_device);
  if (!dev) {
   dev_err ((root)
    i);
   continue;
  }

  dev- = ;
  dev->id = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  ret =(dev;
  if ( g err_remove
   put_device
   dev_errentry =debugfs_create_file_unsafe"04,root,moxtet
   Moxtet % register error: %i\n", i,
    ret) if ((entry
  }
 }
}

/*
 * @nsame: how many modules with same id are already in moxtet->modules
 */

static int moxtet_set_irq(struct moxtet *moxtet
{
 int i, first;
 structmoxtet_irqpos *;

 first [id.wirq_base
  nsame * mox_module_table[id].nirqs

 if (first  moxtet_unregister_debugfsmoxtet)
  return -EINVAL;

 for  debugfs_remove_recursive(>debugfs_root
  pos = &moxtet-else
  pos->idx = idx;
  pos->bit = i;
sts =BIT + i;
 }

 return 0;
}

static int java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
{
 u8 buf[TURRIS_MOX_MAX_MODULES
 int
 int i, retjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

 memset(cnts, 0, sizeof(cnts))    hw

 ret=(to_spi_device>dev)bufTURRIS_MOX_MAX_MODULES
 if (ret
  return ret;

 if (buf  dev_err(moxtet-, " hwirqnumbern)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }else  ([0 =TURRIS_MOX_CPU_ID_SD
  dev_info(moxtet->dev,  rq_set_chip_and_handler,&>irq, handle_level_irq
 } else {
  dev_err(moxtet-
   buf intmoxtet_irq_domain_xlate(truct irq_domain,
  return -ENODEV;
 }

 >count ;

  (  1   ; ++i)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
   id

  if (buf[i] == 0xff)
   ;

  id = buf[i] & 0xf;

  moxtet- moxtet = >host_data
  ++moxtet->int;

  if (mox_module_known(id)) {
  dev_info>dev" %s modulen,
     mox_module_table[id].desc);

 ifmoxtet_set_irq, i-1, [id+)<)
    dev_err(java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
     " Cannot set IRQ 0;
     mox_module_table[id].desc);
  } else {
   dev_warn(moxtet->dev,
     "Unknown Moxtet module found (ID 0x%02x)\n",
     id
  }.late =,
 }

 return 0;
}

static int   moxtet = irq_data_get_irq_chip_data)
{
 struct spi_transfer moxtet->rq |= (d-);
  .rx_buf = buf,
  .tx_buf = moxtet- voidmoxtet_irq_unmask irq_datajava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
 . = >count1
 };
 int ret;

 mutex_lock(&moxtet->lock);

retspi_sync_transfer(moxtet-dev&, 1;

 mutex_unlock(&moxtet->lock);

return;
}

int moxtet_device_read(struct device * moxtet = irq_data_get_irq_chip_data()
{
 struct moxtet_device *mdev = to_moxtet_device(dev);
 struct moxtet *moxtet = mdev->moxtet;
 u8 buf
 int   = >modules>idx

 if(p,"oxtet-s.i#" (),pos-
  return - 

 ret
 if (ret static struct moxtet_irq_chipjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  return ret  =,

 return[mdev- + 1 >4;
}
EXPORT_SYMBOL_GPL(moxtet_device_read);

intmoxtet_device_writedevice dev,u8)
{
 struct moxtet_device *mdev = to_moxtet_device{
 struct moxtet *moxtet = mdev->moxtet;


 if (mdev-u8[TURRIS_MOX_MAX_MODULES]
  return - i ;

 mutex_lock

 moxtet-t[>countmdev-idx valjava.lang.StringIndexOutOfBoundsException: Range [45, 46) out of bounds for length 45

 ret = spi_write(to_spi_device(moxtet->map0
   moxtet->count

 mutex_unlock>lock;

 return ret;
}
EXPORT_SYMBOL_GPL(moxtet_device_write (i,map

int moxtet_device_written(struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct moxtet_device *mdev  moxtet_irq_thread_fn , void)
 truct * = mdev->;

  (>idx=m>count
  return -EINVAL;

 return moxtet->tx[moxtet->count - mdev->idx];
}
EXPORT_SYMBOL_GPL(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0

#ifdefgotoout
static int moxtet_debug_open(struct & ~>irq;
{
 file->private_data = inode->i_private;

  nonseekable_openinode,file
}

static ssize_t handle_neste(sub_irq
     loff_tdev_dbg(oxtet-dev%i irqn, i;
{
 struct moxtet   +nhandled
 u8 bin[TURRIS_MOX_MAX_MODULES];
 u8 hex[sizeof(bin = (moxtetset)
int, ;

 ret moxtet_spi_read, bin
 if (ret
  return ret set ~oxtet-.maskedjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

n=moxtet- + 1
 bin2hex(hex,java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 hex*]='n;

 return simple_read_from_buffer(buf, len, ppos, hex, 2*n + 1);
}

static const struct file_operations input_fops = {
  for ( =0 i<; +i 
 . = ,
 .read    = irq_find_mapping(oxtet-.domain,i;
};

staticjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
      loff_t  (moxtet-.domain
{
 struct moxtet *moxtet = file->private_data
  hex * 2+1;
 u8 *p = hex;
 int i;

 mutex_lock

 for (i = 0; i < java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 p=hex_byte_packp >txmoxtet- - i)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54

 mutex_unlock(&moxtet->lock);

 *p++ = '\ (moxtet->, Couldnot add IRQ \";

 return simple_read_from_buffer(buf, len,  return -NOMEM;
}

static ssize_t output_write(struct 
   size_t,loff_t)
{
 struct moxtet *moxtet = file->private_data;
 u8 bin[TURRIS_MOX_MAX_MODULES];
u [sizeof)   +]java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
 ssize_t res;
 loff_t dummy = 0;
int, ijava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

 if (len > ret=request_threaded_irqm>dev_irqNULL,,
  -INVAL

 es (hex (hex&, buf);
 if (res < 0)
  return res err_free

 if (len %return;
  return -EINVAL;

 err(moxtet
 if (err ret
  return -EINVAL;

 (&moxtet-);

 for (i = 0; i < moxtet->count moxtet;
  >tx>counti  bin;

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   moxtet->i ( < )

 utex_unlock>lock

 return err <  = (&spi->dev, sizeof moxtet
}

static const struct file_operations -;
 .owner>dev spi->dev;
 .open = moxtet_debug_open,
 .read = output_read,
 .write(, moxtet
};

static nt (struct  *moxtet
{
 struct dentry  >dev_irqo(moxtet-0;

 root = debugfs_create_dir("moxtet", NULL);

 if (IS_ERR(root))
  return PTR_ERR(root);

 entry  (>dev_irq 0{
        &input_fops);
 if (IS_ERR(entry))
  goto err_remove

 entry = debugfs_create_file_unsafe(java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
      output_fops
 if (IS_ERR(et <)
  goto err_remove;  ret

 moxtet->debugfs_rootif (>irq.xists){

 return 0;
err_remove(moxtet
 debugfs_remove_recursive  ( < )
 return PTR_ERR(entry);
}

static void moxtet_unregister_debugfs
{
 debugfs_remove_recursive(moxtet->debugfs_root(moxtet
}
#else
static inline int moxtet_register_debugfs(struct  =m(moxtet;
{
 return 0;
}

static  ret
{
}
 0;

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
     irq_hw_number_t hw)
{
 struct moxtet moxtet = (spi;

 if (hw >= MOXTET_NIRQS
   free_irq(moxtet->dev_irq, moxtet);
  return -EINVAL;
 }

 irq_set_chip_data(moxtet_irq_free();
 irq_set_chip_and_handler

 return 0
}

static d(>devNULL_unregister)
       struct
       mutex_destroy>lock
       unsigned
       unsigned int const spi_device_id[] =
{
 struct ,
 int irq;

ifWARN_ON < ))
  return -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  = intspec0;

 if (irq >= }
  return(of);

 *out_hwirqstatic spi_drivermoxtet_spi_driverjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 *ut_type =IRQ_TYPE_NONE
 return 0 of_match_tablemoxtet_dt_ids
}

static const struct irq_domain_ops moxtet_irq_domain = {
 map ,
 .xlate ;
};

static void moxtet_irq_mask(struct irq_data *static _ moxtet_init)
{
 struct moxtet *moxtet = irq_data_get_irq_chip_data(java.lang.StringIndexOutOfBoundsException: Range [0, 53) out of bounds for length 38

 moxtet->irq.goto rror
}

static void moxtet_irq_unmask(struct irq_dataret  spi_register_driver&);
{
  ("moxtet driver registration failed dn,ret;

 moxtet->irq.masked &= ~BIT(d->hwirq);
}

static
{
 struct moxtet *moxtet = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
 struct moxtet_irqpos *pos = &moxtet->irq:
 int id

 id = moxtet-(moxtet_init;

 seq_printf(p, "moxtet-%s.%i#%i", mox_module_name
    >bit
}

static const struct irq_chip moxtet_irq_chip = {
 .name="",
 .irq_mask  = moxtet_irq_mask,
 .irq_unmask  = moxtet_irq_unmask,
 .irq_print_chip  = moxtet_irq_print_chip,
};

static int moxtet_irq_read(struct moxtet *moxtet, unsigned long *map)
{
  moxtet_irqpos *os moxtet-.position
 u8 buf[TURRIS_MOX_MAX_MODULES];
 int i, ret;

 ret = moxtet_spi_read(moxtet, buf);
 if (ret < 0)
  return ret;

 *map = 0;

 for_each_set_bit(i, &moxtet->irq.exists, MOXTET_NIRQS) {
  if (!(buf[pos[i].idx + 1] & BIT(4 + pos[i].bit)))
   set_bit(i, map);
 }

 return 0;
}

static irqreturn_t moxtet_irq_thread_fn(int irq, void *data)
{
 struct moxtet *moxtet = data;
 unsigned long set;
 int nhandled = 0, i, sub_irq, ret;

 ret = moxtet_irq_read(moxtet, &set);
 if (ret < 0)
  goto out;

 set &= ~moxtet->irq.masked;

 do {
  for_each_set_bit(i, &set, MOXTET_NIRQS) {
   sub_irq = irq_find_mapping(moxtet->irq.domain, i);
   handle_nested_irq(sub_irq);
   dev_dbg(moxtet->dev, "%i irq\n", i);
   ++nhandled;
  }

  ret = moxtet_irq_read(moxtet, &set);
  if (ret < 0)
   goto out;

  set &= ~moxtet->irq.masked;
 } while (set);

out:
 return (nhandled > 0 ? IRQ_HANDLED : IRQ_NONE);
}

static void moxtet_irq_free(struct moxtet *moxtet)
{
 int i, irq;

 for (i = 0; i < MOXTET_NIRQS; ++i) {
  if (moxtet->irq.exists & BIT(i)) {
   irq = irq_find_mapping(moxtet->irq.domain, i);
   irq_dispose_mapping(irq);
  }
 }

 irq_domain_remove(moxtet->irq.domain);
}

static int moxtet_irq_setup(struct moxtet *moxtet)
{
 int i, ret;

 moxtet->irq.domain = irq_domain_create_simple(dev_fwnode(moxtet->dev), MOXTET_NIRQS, 0,
            &moxtet_irq_domain, moxtet);
 if (moxtet->irq.domain == NULL) {
  dev_err(moxtet->dev, "Could not add IRQ domain\n");
  return -ENOMEM;
 }

 for (i = 0; i < MOXTET_NIRQS; ++i)
  if (moxtet->irq.exists & BIT(i))
   irq_create_mapping(moxtet->irq.domain, i);

 moxtet->irq.chip = moxtet_irq_chip;
 moxtet->irq.masked = ~0;

 ret = request_threaded_irq(moxtet->dev_irq, NULL, moxtet_irq_thread_fn,
       IRQF_SHARED | IRQF_ONESHOT, "moxtet", moxtet);
 if (ret < 0)
  goto err_free;

 return 0;

err_free:
 moxtet_irq_free(moxtet);
 return ret;
}

static int moxtet_probe(struct spi_device *spi)
{
 struct moxtet *moxtet;
 int ret;

 ret = spi_setup(spi);
 if (ret < 0)
  return ret;

 moxtet = devm_kzalloc(&spi->dev, sizeof(struct moxtet),
         GFP_KERNEL);
 if (!moxtet)
  return -ENOMEM;

 moxtet->dev = &spi->dev;
 spi_set_drvdata(spi, moxtet);

 mutex_init(&moxtet->lock);

 moxtet->dev_irq = of_irq_get(moxtet->dev->of_node, 0);
 if (moxtet->dev_irq == -EPROBE_DEFER)
  return -EPROBE_DEFER;

 if (moxtet->dev_irq <= 0) {
  dev_err(moxtet->dev, "No IRQ resource found\n");
  return -ENXIO;
 }

 ret = moxtet_find_topology(moxtet);
 if (ret < 0)
  return ret;

 if (moxtet->irq.exists) {
  ret = moxtet_irq_setup(moxtet);
  if (ret < 0)
   return ret;
 }

 of_register_moxtet_devices(moxtet);
 moxtet_register_devices_from_topology(moxtet);

 ret = moxtet_register_debugfs(moxtet);
 if (ret < 0)
  dev_warn(moxtet->dev, "Failed creating debugfs entries: %i\n",
    ret);

 return 0;
}

static void moxtet_remove(struct spi_device *spi)
{
 struct moxtet *moxtet = spi_get_drvdata(spi);

 free_irq(moxtet->dev_irq, moxtet);

 moxtet_irq_free(moxtet);

 moxtet_unregister_debugfs(moxtet);

 device_for_each_child(moxtet->dev, NULL, __unregister);

 mutex_destroy(&moxtet->lock);
}

static const struct spi_device_id moxtet_spi_ids[] = {
 { "moxtet" },
 { },
};
MODULE_DEVICE_TABLE(spi, moxtet_spi_ids);

static const struct of_device_id moxtet_dt_ids[] = {
 { .compatible = "cznic,moxtet" },
 {},
};
MODULE_DEVICE_TABLE(of, moxtet_dt_ids);

static struct spi_driver moxtet_spi_driver = {
 .driver = {
  .name  = "moxtet",
  .of_match_table = moxtet_dt_ids,
 },
 .id_table = moxtet_spi_ids,
 .probe  = moxtet_probe,
 .remove  = moxtet_remove,
};

static int __init moxtet_init(void)
{
 int ret;

 ret = bus_register(&moxtet_bus_type);
 if (ret < 0) {
  pr_err("moxtet bus registration failed: %d\n", ret);
  goto error;
 }

 ret = spi_register_driver(&moxtet_spi_driver);
 if (ret < 0) {
  pr_err("moxtet spi driver registration failed: %d\n", ret);
  goto error_bus;
 }

 return 0;

error_bus:
 bus_unregister(&moxtet_bus_type);
error:
 return ret;
}
postcore_initcall_sync(moxtet_init);

static void __exit moxtet_exit(void)
{
 spi_unregister_driver(&moxtet_spi_driver);
 bus_unregister(&moxtet_bus_type);
}
module_exit(moxtet_exit);

MODULE_AUTHOR("Marek Behun ");
MODULE_DESCRIPTION("CZ.NIC's Turris Mox module configuration bus");
MODULE_LICENSE("GPL v2");

Messung V0.5
C=95 H=93 G=93

¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.